Commit 69bf0a64 authored by lixiaofang's avatar lixiaofang

a

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