Commit 16db11dd authored by lixiaofang's avatar lixiaofang

add

parent 2c6edb5e
This diff is collapsed.
...@@ -4,7 +4,7 @@ import random ...@@ -4,7 +4,7 @@ import random
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, click, time_conv from auto_request import login, click
def write_id_file(): def write_id_file():
...@@ -34,7 +34,7 @@ if __name__ == "__main__": ...@@ -34,7 +34,7 @@ if __name__ == "__main__":
randoms_id = [] randoms_id = []
for i in range(lenn % 2): for i in range(lenn/2):
rand_num = random.randint(0, len(user_ids)-1) rand_num = random.randint(0, len(user_ids)-1)
randoms_id.append(user_ids[rand_num]) randoms_id.append(user_ids[rand_num])
......
...@@ -33,7 +33,7 @@ if __name__ == "__main__": ...@@ -33,7 +33,7 @@ if __name__ == "__main__":
randoms_id = [] randoms_id = []
for i in range(lenn % 2): for i in range(lenn/2):
rand_num = random.randint(0, len(user_ids) - 1) rand_num = random.randint(0, len(user_ids) - 1)
randoms_id.append(user_ids[rand_num]) randoms_id.append(user_ids[rand_num])
if randoms_id: if randoms_id:
......
...@@ -2,9 +2,9 @@ import time ...@@ -2,9 +2,9 @@ import time
import pymysql import pymysql
import random import random
import traceback import traceback
from log_settings import * # from log_settings import *
import logging import logging
from auto_request import login, click, time_conv,get_comment,reply from auto_request import login, time_conv, get_comment, reply
from auto_request import host, user, db, passwd from auto_request import host, user, db, passwd
...@@ -81,7 +81,6 @@ if __name__ == "__main__": ...@@ -81,7 +81,6 @@ if __name__ == "__main__":
comment = get_comment() comment = get_comment()
if cook is not None: if cook is not None:
write_id_file(rand_id) write_id_file(rand_id)
reply(cook, rand_id, comment) reply(cook, rand_id, comment)
......
...@@ -4,7 +4,7 @@ import random ...@@ -4,7 +4,7 @@ import random
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, click, time_conv,reply,get_comment from auto_request import login, reply, get_comment
def write_id_file(): def write_id_file():
...@@ -34,8 +34,8 @@ if __name__ == "__main__": ...@@ -34,8 +34,8 @@ if __name__ == "__main__":
randoms_id = [] randoms_id = []
for i in range(lenn % 2): for i in range(lenn / 2):
rand_num = random.randint(0, len(user_ids)-1) rand_num = random.randint(0, len(user_ids) - 1)
randoms_id.append(user_ids[rand_num]) randoms_id.append(user_ids[rand_num])
...@@ -50,7 +50,6 @@ if __name__ == "__main__": ...@@ -50,7 +50,6 @@ if __name__ == "__main__":
cook = login() cook = login()
if cook is not None: if cook is not None:
reply(cook, i, comment) reply(cook, i, comment)
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
...@@ -2,7 +2,7 @@ import time ...@@ -2,7 +2,7 @@ import time
import pymysql import pymysql
import random import random
import traceback import traceback
from log_settings import * # from log_settings import *
import logging import logging
from auto_request import login, click, time_conv, get_comment, reply from auto_request import login, click, time_conv, get_comment, reply
...@@ -32,12 +32,10 @@ if __name__ == "__main__": ...@@ -32,12 +32,10 @@ if __name__ == "__main__":
lenn = len(user_ids) lenn = len(user_ids)
randoms_id = [] randoms_id = []
for i in range(int(lenn / 2)):
for i in range(lenn % 2):
rand_num = random.randint(0, len(user_ids) - 1) rand_num = random.randint(0, len(user_ids) - 1)
randoms_id.append(user_ids[rand_num]) randoms_id.append(user_ids[rand_num])
if randoms_id: if randoms_id:
for i in randoms_id: for i in randoms_id:
time.sleep(random.randint(10, 50)) time.sleep(random.randint(10, 50))
......
213
13
13
13
31
1
3
13
13
13
\ No newline at end of file
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