Commit 70e95e89 authored by lixiaofang's avatar lixiaofang

majia new

parent 81c37f5c
This diff is collapsed.
......@@ -25,11 +25,9 @@ def get_majia():
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, 300)
maj = random.randint(1,len(list))
user_id=list[maj]
......@@ -39,20 +37,14 @@ def login():
# time.sleep(random.randint(300, 500))
num_majia = random.randint(1, 300)
# user_id=majia[num_majia]
user = 's_PzFznI@shadow.com'
pwd = '123456'
user_id=get_majia()
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':user_id
}
response = requests.post(
url=login_url,
......@@ -201,26 +193,26 @@ if __name__ == "__main__":
#get majia zhanghao
data = get_follw_majia(numtime, id)
dict = {}
for i in data:
if i[0] not in dict:
dict.setdefault(i[0], [])
dict[i[0]].append(i[1])
else:
dict[i[0]].append(i[1])
for key, value in dict.items():
cookies = logins(key)
for id in value:
follow(cookies, id)
# data = get_follw_majia(numtime, id)
#
# dict = {}
#
# for i in data:
#
# if i[0] not in dict:
# dict.setdefault(i[0], [])
# dict[i[0]].append(i[1])
#
# else:
# dict[i[0]].append(i[1])
#
# for key, value in dict.items():
#
# cookies = logins(key)
#
# for id in value:
#
# follow(cookies, id)
......
......@@ -28,11 +28,9 @@ def get_majia():
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, 300)
maj = random.randint(1,len(list))
user_id=list[maj]
......@@ -44,13 +42,7 @@ def login():
# time.sleep(random.randint(300, 500))
num_majia = random.randint(1, 300)
user_id=get_majia[num_majia]
# user = 's_PzFznI@shadow.com'
#
# pwd = '123456'
user_id=get_majia()
cookies = index_first()
......
......@@ -14,24 +14,30 @@ def index_first():
return r1.cookies.get_dict()
def login():
def get_majia():
# time.sleep(random.randint(300, 500))
data = open("batch user gen")
num_majia = random.randint(1, 300)
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
# user_id=majia[num_majia]
# time.sleep(random.randint(0, 500))
user = 's_PzFznI@shadow.com'
maj = random.randint(1, len(list))
pwd = '123456'
user_id=list[maj-1]
return list
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -47,8 +53,6 @@ def login():
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def click(cookies_get, id):
......@@ -117,7 +121,7 @@ if __name__ == "__main__":
cookies = index_first()
cook=login()
cook=logins()
click(cook, rand_id)
......@@ -28,36 +28,22 @@ def get_majia():
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1, 300)
user_id=list[maj]
print(user_id)
return user_id
def login():
# time.sleep(random.randint(300, 500))
num_majia = random.randint(1, 300)
user_id=list[maj-1]
# user_id=majia[num_majia]
return list
user = 's_PzFznI@shadow.com'
pwd = '123456'
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -73,8 +59,6 @@ def login():
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def follow(cookies_get, id):
......@@ -123,7 +107,7 @@ if __name__ == "__main__":
cookies = index_first()
cook=login()
cook=logins()
follow(cook, id)
......
......@@ -17,22 +17,30 @@ def index_first():
return r1.cookies.get_dict()
def login():
def get_majia():
num_majia = random.randint(1, 300)
data = open("batch user gen")
# user_id=majia[num_majia]
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
user = 's_FF3qUO@shadow.com'
# time.sleep(random.randint(0, 500))
pwd = '123456'
maj = random.randint(1, len(list))
user_id=list[maj-1]
return list
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -48,8 +56,6 @@ def login():
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def reply(cookies_get,id,content):
......@@ -114,7 +120,7 @@ if __name__ == "__main__":
for i in topic_id:
cook = login()
cook = logins()
comment = get_comment()
......
......@@ -14,24 +14,30 @@ def index_first():
r1=requests.get(login_url)
return r1.cookies.get_dict()
def login():
def get_majia():
# time.sleep(random.randint(300, 500))
data = open("batch user gen")
num_majia = random.randint(1, 300)
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
# user_id=majia[num_majia]
# time.sleep(random.randint(0, 500))
user = 's_PzFznI@shadow.com'
maj = random.randint(1, len(list))
pwd = '123456'
user_id=list[maj-1]
return list
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -137,7 +143,7 @@ if __name__ == "__main__":
# time.sleep(random.randint(500, 1500))
cookies=login()
cookies=logins()
follow(cookies, id)
......@@ -154,7 +160,7 @@ if __name__ == "__main__":
# time.sleep(random.randint(500, 1500))
cookies = login()
cookies = logins()
pick(cookies, id)
......
......@@ -12,24 +12,30 @@ def index_first():
r1=requests.get(login_url)
return r1.cookies.get_dict()
def login():
def get_majia():
# time.sleep(random.randint(300, 500))
data = open("batch user gen")
num_majia = random.randint(1, 300)
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
# user_id=majia[num_majia]
# time.sleep(random.randint(0, 500))
user = 's_PzFznI@shadow.com'
maj = random.randint(1, len(list))
pwd = '123456'
user_id=list[maj-1]
return list
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -174,7 +180,7 @@ if __name__ == "__main__":
for i in range(follow_num):
cookies = login()
cookies = logins()
follow(cookies, id)
......
......@@ -25,13 +25,11 @@ def get_majia():
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]
maj = random.randint(1, len(list))
user_id=list[maj-1]
return list
......@@ -94,7 +92,6 @@ def get_follw_majia(numtime,id):
return data
if __name__ == "__main__":
numtime=time_conv()
......
......@@ -32,36 +32,22 @@ def get_majia():
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1, 300)
user_id=list[maj]
print(user_id)
return user_id
def login():
# time.sleep(random.randint(300, 500))
num_majia = random.randint(1, 300)
user_id=list[maj-1]
# user_id=majia[num_majia]
return list
user = 's_PzFznI@shadow.com'
pwd = '123456'
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -77,8 +63,6 @@ def login():
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def follow(cookies_get, id):
......@@ -143,7 +127,7 @@ if __name__ == "__main__":
cookies = index_first()
cook=login()
cook=logins()
pick(cook, id)
......
......@@ -14,22 +14,30 @@ def index_first():
return r1.cookies.get_dict()
def login():
def get_majia():
num_majia = random.randint(1, 300)
data = open("batch user gen")
# user_id=majia[num_majia]
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
user = 's_PzFznI@shadow.com'
# time.sleep(random.randint(0, 500))
pwd = '123456'
maj = random.randint(1, len(list))
user_id=list[maj-1]
return list
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -202,7 +210,7 @@ if __name__ == "__main__":
for x in range(pick_num):
cookies = login()
cookies = logins()
pick(cookies, i)
......
......@@ -20,40 +20,31 @@ def index_first():
return r1.cookies.get_dict()
def get_majia():
data = open("batch user gen")
list = []
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, 300)
user_id = list[maj]
print(user_id)
return user_id
def login():
# time.sleep(random.randint(300, 500))
num_majia = random.randint(1, 300)
maj = random.randint(1, len(list))
# user_id=majia[num_majia]
user_id=list[maj-1]
user = 's_PzFznI@shadow.com'
return list
pwd = '123456'
def logins(id):
cookies = index_first()
post_dict = {
'account_type': 2,
'pwd': pwd,
'email': user
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -61,7 +52,7 @@ def login():
cookies=cookies
)
headers = response.headers
headers=response.headers
cook = headers['Set-Cookie'].split(";")
......@@ -69,8 +60,6 @@ def login():
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def Urge(cookies_get, id):
......@@ -89,7 +78,6 @@ def time_conv(numtime):
yes_time_str = yes_time.strftime('%Y-%m-%d')
return yes_time_str
def get_data(numtime):
db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123',
db="alpha", port=3306)
......@@ -102,7 +90,6 @@ def get_data(numtime):
db.close()
return user_id
if __name__ == "__main__":
# time.sleep(random.randint(3000,4500))
......@@ -118,9 +105,9 @@ if __name__ == "__main__":
for i in range(urge_num):
cookies = index_first()
cook = login()
cook = logins()
follow(cook, id)
Urge(cook, id)
......
......@@ -30,26 +30,22 @@ def get_majia():
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
maj = random.randint(1, 300)
user_id=list[maj]
return user_id
user_id=list[maj-1]
def login():
return list
user_id=get_majia()
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':'123456',
'email':user_id
'email':id
}
response = requests.post(
url=login_url,
......@@ -65,8 +61,6 @@ def login():
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def click(cookies_get, id):
......@@ -165,7 +159,7 @@ if __name__ == "__main__":
for i in range(urge_num):
cookies = login()
cookies = logins()
follow(cookies,id)
......
......@@ -14,22 +14,30 @@ def index_first():
r1=requests.get(login_url)
return r1.cookies.get_dict()
def login():
def get_majia():
num_majia = random.randint(1, 300)
data = open("batch user gen")
# user_id=majia[num_majia]
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
user = 's_PzFznI@shadow.com'
# time.sleep(random.randint(0, 500))
pwd = '123456'
maj = random.randint(1, len(list))
user_id=list[maj-1]
return list
def logins(id):
cookies = index_first()
post_dict={
'account_type':2,
'pwd':pwd,
'email':user
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -121,7 +129,7 @@ if __name__ == "__main__":
for i in range(urge_num):
cookies=login()
cookies=logins()
Urge(cookies, id)
......@@ -142,7 +150,7 @@ if __name__ == "__main__":
for i in range(1):
cookies = login()
cookies = logins()
Urge(cookies, id)
......
......@@ -21,39 +21,29 @@ def index_first():
return r1.cookies.get_dict()
def get_majia():
data = open("batch user gen")
list = []
list=[]
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, 300)
user_id = list[maj]
print(user_id)
return user_id
maj = random.randint(1, len(list))
def login():
# time.sleep(random.randint(300, 500))
user_id=list[maj-1]
num_majia = random.randint(1, 300)
return list
# user_id=majia[num_majia]
user = 's_PzFznI@shadow.com'
pwd = '123456'
def logins(id):
cookies = index_first()
post_dict = {
'account_type': 2,
'pwd': pwd,
'email': user
post_dict={
'account_type':2,
'pwd':'123456',
'email':id
}
response = requests.post(
url=login_url,
......@@ -61,7 +51,7 @@ def login():
cookies=cookies
)
headers = response.headers
headers=response.headers
cook = headers['Set-Cookie'].split(";")
......@@ -69,8 +59,6 @@ def login():
print(response.text, 'url')
print(cook)
return {'sessionid': cook}
def pick(cookies_get,id):
......@@ -120,7 +108,7 @@ if __name__ == "__main__":
for i in range(urge_num):
cookies = index_first()
cook = login()
cook = logins()
pick(cook, 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