Commit 82a54b5e authored by lixiaofang's avatar lixiaofang

majia new

parent dc78a2b3
This diff is collapsed.
......@@ -17,15 +17,15 @@ def index_first():
return r1.cookies.get_dict()
def get_majia():
data = open("batch user gen")
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
return list
# def get_majia():
#
# data = open("batch user gen")
#
# list=[]
# for i in data:
# list.append(i.strip('\n').strip(','))
#
# return list
def logins(id):
......@@ -76,9 +76,9 @@ def get_follw_majia(numtime,id):
cursor = db.cursor()
print("---------")
cursor.execute("select temp1.user_id,temp1.email ,temp2.follow_id from account_user_auth temp1 left join "
cursor.execute("select temp1.user_id,temp1.email,temp2.follow_id from account_user_auth temp1 left join "
"(select user_id,follow_id from user_follow) "
" temp2 on temp1.user_id=temp2.user_id where temp1.user_id in %s ",('s_05tmwu@shadow.com','s_07CRHt@shadow.com','s_0bdxxU@shadow.com','s_0mfxcO@shadow.com','s_0u6eaV@shadow.com','s_0UudEr@shadow.com','s_1b3v5V@shadow.com','s_1dbAoA@shadow.com','s_1dholX@shadow.com','s_1EpLlt@shadow.com','s_1iyrBU@shadow.com'))
" temp2 on temp1.user_id=temp2.user_id where temp1.email in ('s_05tmwu@shadow.com','s_07CRHt@shadow.com','s_0bdxxU@shadow.com','s_0mfxcO@shadow.com','s_0u6eaV@shadow.com','s_0UudEr@shadow.com','s_1b3v5V@shadow.com','s_1dbAoA@shadow.com','s_1dholX@shadow.com','s_1EpLlt@shadow.com','s_1iyrBU@shadow.com')")
data = cursor.fetchall()
......@@ -98,28 +98,55 @@ if __name__ == "__main__":
data = get_follw_majia(numtime, id)
dict = {}
dict_follow_id = {}
for j in data:
if j[2] != None:
if j[0] not in dict_follow_id.keys():
for i in data:
dict_follow_id.setdefault(j[0], [])
if i[0] not in dict:
dict.setdefault(i[0], [])
dict[i[0]].append(i[1])
dict_follow_id[j[0]].append(j[2])
else:
dict[i[0]].append(i[1])
dict_follow_id[j[0]].append(j[2])
dict_email = {}
for j in data:
if j[2] != None:
if j[0] not in dict_email.keys():
dict_email.setdefault(j[0], [])
dict_email[j[0]].append(j[1])
else:
dict_email[j[0]].append(j[1])
for key, value in dict_follow_id.items():
id = dict_email[key][0]
for i in value:
cookies=logins()
follow(cookies,i)
for key, value in dict.items():
majia =get_majia()
if key in majia:
cookies = logins(key)
for id in value:
follow(cookies, id)
# import random
#
#
# def get_majia():
#
# data = open("batch user gen")
#
# list=[]
# for i in data:
# list.append(i.strip('\n').strip(','))
#
#
# # time.sleep(random.randint(0, 500))
#
#
# maj = random.randint(1, len(list))
#
# user_id=list[maj]
#
# return user_id
#
# print(get_majia())
data = open("batch user gen")
list = []
for i in data:
list.append(i.strip('\n').strip(','))
print(list)
l = 's_0bdxxU@shadow.com'
if l in list:
print(l)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment