Commit 69bf0a64 authored by lixiaofang's avatar lixiaofang

a

parent 9704f60e
...@@ -34,22 +34,33 @@ if __name__ == "__main__": ...@@ -34,22 +34,33 @@ if __name__ == "__main__":
randoms_id = [] randoms_id = []
print(user_ids) if lenn ==1:
for i in range(int(lenn/2)):
rand_num = random.randint(0, len(user_ids)-1)
randoms_id.append(user_ids[rand_num]) time.sleep(random.randint(10, 50))
if randoms_id: cook = login()
for i in randoms_id: if cook is not None:
click(cook, user_ids[0])
time.sleep(random.randint(10, 50))
cook = login() else:
if cook is not None: for i in range(int(lenn/2)):
click(cook, i) rand_num = random.randint(0, len(user_ids)-1)
randoms_id.append(user_ids[rand_num])
if randoms_id:
for i in randoms_id:
time.sleep(random.randint(10, 50))
cook = login()
if cook is not None:
click(cook, i)
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
...@@ -33,19 +33,30 @@ if __name__ == "__main__": ...@@ -33,19 +33,30 @@ if __name__ == "__main__":
randoms_id = [] randoms_id = []
for i in range(lenn/2): if lenn == 1:
rand_num = random.randint(0, len(user_ids) - 1)
randoms_id.append(user_ids[rand_num])
if randoms_id:
for i in randoms_id: time.sleep(random.randint(10, 50))
time.sleep(random.randint(10, 50)) cook = login()
cook = login() if cook is not None:
click(cook, user_ids[0])
if cook is not None: else:
click(cook, i)
for i in range(int(lenn / 2)):
rand_num = random.randint(0, len(user_ids) - 1)
randoms_id.append(user_ids[rand_num])
if randoms_id:
for i in randoms_id:
time.sleep(random.randint(10, 50))
cook = login()
if cook is not None:
click(cook, i)
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
...@@ -61,31 +61,29 @@ if __name__ == "__main__": ...@@ -61,31 +61,29 @@ if __name__ == "__main__":
user_id = get_data(numtime1, numtime2) user_id = get_data(numtime1, numtime2)
dicts = {} dicts = {}
if user_id: for i in user_id and user_id:
if i[0] not in dicts.keys():
dicts.setdefault(i[0], [])
dicts[i[0]].append(i[1])
else:
dicts[i[0]].append(i[1])
for i in user_id: for key, value in dicts.items():
if i[0] not in dicts.keys():
dicts.setdefault(i[0], [])
dicts[i[0]].append(i[1])
else:
dicts[i[0]].append(i[1])
for key, value in dicts.items(): rand_num = random.randint(0, len(value) - 1)
rand_num = random.randint(0, len(value) - 1) rand_id = value[rand_num]
rand_id = value[rand_num] time.sleep(random.randint(1, 10))
time.sleep(random.randint(1, 10)) cook = login()
cook = login() comment = get_comment()
comment = get_comment() if cook is not None:
write_id_file(rand_id)
if cook is not None: reply(cook, rand_id, comment)
write_id_file(rand_id)
reply(cook, rand_id, comment)
......
...@@ -34,23 +34,34 @@ if __name__ == "__main__": ...@@ -34,23 +34,34 @@ if __name__ == "__main__":
randoms_id = [] randoms_id = []
for i in range(int(lenn / 2)): if lenn == 1:
time.sleep(random.randint(10, 50))
rand_num = random.randint(0, len(user_ids) - 1) comment = get_comment()
randoms_id.append(user_ids[rand_num]) cook = login()
if randoms_id: if cook is not None:
reply(cook, user_ids[0], comment)
for i in randoms_id: else:
time.sleep(random.randint(10, 50)) for i in range(int(lenn / 2)):
rand_num = random.randint(0, len(user_ids) - 1)
comment = get_comment() randoms_id.append(user_ids[rand_num])
cook = login() if randoms_id:
if cook is not None: for i in randoms_id:
reply(cook, i, comment)
time.sleep(random.randint(10, 50))
comment = get_comment()
cook = login()
if cook is not None:
reply(cook, i, comment)
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
...@@ -32,22 +32,37 @@ if __name__ == "__main__": ...@@ -32,22 +32,37 @@ if __name__ == "__main__":
lenn = len(user_ids) lenn = len(user_ids)
randoms_id = [] randoms_id = []
for i in range(int(lenn/2)):
rand_num = random.randint(0, len(user_ids) - 1)
randoms_id.append(user_ids[rand_num])
if randoms_id:
for i in randoms_id:
time.sleep(random.randint(10, 50)) if lenn == 1:
cook = login() time.sleep(random.randint(10, 50))
comment = get_comment() cook = login()
cook = login() comment = get_comment()
if cook is not None: cook = login()
reply(cook, i, comment)
if cook is not None:
reply(cook, user_ids[0], comment)
else:
for i in range(int(lenn / 2)):
rand_num = random.randint(0, len(user_ids) - 1)
randoms_id.append(user_ids[rand_num])
if randoms_id:
for i in randoms_id:
time.sleep(random.randint(10, 50))
cook = login()
comment = get_comment()
cook = login()
if cook is not None:
reply(cook, i, comment)
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
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