Commit 0fe9b638 authored by lixiaofang's avatar lixiaofang

majia new

parent 73f5596c
......@@ -6,7 +6,7 @@ import random
import pandas as pd
auto_click_url = "http://earth.igengmei.com/api/v1/like"
auto_click_url = "http://earth.igengmei.com/api/v1/reply/create"
auto_reply_url = "http://earth.igengmei.com/api/v1/reply/create"
auto_follow_url = "http://earth.igengmei.com/api/v1/follow"
login_url = "http://earth.igengmei.com/api/account/login_pwd"
......@@ -124,7 +124,7 @@ def reply(cookies_get,id,content):
'topic_id':id,
'content':content
}
response=requests.post(url=auto_click_url,
response=requests.post(url=auto_reply_url,
cookies=cookies_get,
data=post_dict)
......@@ -184,7 +184,7 @@ def get_follw_majia(numtime,id):
if __name__ == "__main__":
numtime=time_conv(0)
numtime=time_conv()
topic_id = get_topic_id(numtime)
......@@ -202,42 +202,42 @@ if __name__ == "__main__":
click(cookies, id)
# # time.sleep(random.randint(500, 1500))
#
# comment_num = random.randint(1, 3)
#
# for i in range(comment_num):
#
# # time.sleep(random.randint(500, 1500))
#
# cookies= login()
#
# comment = get_comment()
#
# reply(cookies, id, comment)
#
# #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)
# time.sleep(random.randint(500, 1500))
comment_num = random.randint(1, 3)
for i in range(comment_num):
# time.sleep(random.randint(500, 1500))
cookies= login()
comment = get_comment()
reply(cookies, id, comment)
#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)
......
......@@ -4,12 +4,6 @@ import datetime
import pymysql
import random
s = requests.session()
s.keep_alive = False
requests.adapters.DEFAULT_RETRIES = 5
auto_click_url = "http://earth.igengmei.com/api/v1/like"
login_url = "http://earth.igengmei.com/api/account/login_pwd"
......
......@@ -6,7 +6,7 @@ import random
import pandas as pd
auto_click_url = "http://earth.igengmei.com/api/v1/reply/create"
auto_reply_url = "http://earth.igengmei.com/api/v1/reply/create"
login_url = "http://earth.igengmei.com/api/account/login_pwd"
......@@ -58,7 +58,7 @@ def reply(cookies_get,id,content):
'topic_id':id,
'content':content
}
response=requests.post(url=auto_click_url,
response=requests.post(url=auto_reply_url,
cookies=cookies_get,
data=post_dict)
......
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