Commit e5694945 authored by lixiaofang's avatar lixiaofang

majia new

parent 70e95e89
This diff is collapsed.
......@@ -32,7 +32,7 @@ def get_majia():
maj = random.randint(1,len(list))
user_id=list[maj]
user_id=list[maj-1]
print(user_id)
......
......@@ -24,20 +24,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -53,6 +59,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def click(cookies_get, id):
......
......@@ -30,20 +30,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -59,6 +65,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def follow(cookies_get, id):
......
......@@ -27,20 +27,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -56,6 +62,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def reply(cookies_get,id,content):
......
......@@ -24,20 +24,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -53,6 +59,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def follow(cookies_get, id):
......
......@@ -22,20 +22,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -51,6 +57,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def follow(cookies_get, id):
......@@ -158,7 +166,7 @@ if __name__ == "__main__":
# time.sleep(random.randint(500, 1500))
cookies=login()
cookies=logins()
follow(cookies, id)
......
......@@ -34,20 +34,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -63,6 +69,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def follow(cookies_get, id):
......
......@@ -24,11 +24,44 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
return user_id
def login():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':user_id
}
response = requests.post(
url=login_url,
data=post_dict,
cookies=cookies
)
headers=response.headers
cook = headers['Set-Cookie'].split(";")
cook = cook[0].split('=')[1]
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def logins(id):
......@@ -210,7 +243,7 @@ if __name__ == "__main__":
for x in range(pick_num):
cookies = logins()
cookies = logins(id)
pick(cookies, i)
......
......@@ -20,7 +20,6 @@ def index_first():
return r1.cookies.get_dict()
def get_majia():
data = open("batch user gen")
......@@ -31,20 +30,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
return user_id
def logins():
# time.sleep(random.randint(300, 500))
def logins(id):
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -60,6 +65,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def Urge(cookies_get, id):
......
......@@ -32,20 +32,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -61,6 +67,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def click(cookies_get, id):
......@@ -141,7 +149,7 @@ if __name__ == "__main__":
for i in range(urge_num):
cookies = login()
cookies = logins()
click(cookies, id)
......
......@@ -24,20 +24,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -53,6 +59,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def Urge(cookies_get, id):
......
......@@ -30,20 +30,26 @@ def get_majia():
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1,len(list))
user_id=list[maj-1]
return list
print(user_id)
def logins(id):
return user_id
def logins():
# time.sleep(random.randint(300, 500))
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -59,6 +65,8 @@ def logins(id):
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def pick(cookies_get,id):
......
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