Commit d85f55b5 authored by lixiaofang's avatar lixiaofang

update

parent 6571cc7b
This diff is collapsed.
...@@ -33,8 +33,6 @@ def get_majia(): ...@@ -33,8 +33,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
......
...@@ -36,8 +36,6 @@ def get_majia(): ...@@ -36,8 +36,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -51,8 +49,6 @@ def get_majia(): ...@@ -51,8 +49,6 @@ def get_majia():
def login(): def login():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
...@@ -134,8 +130,6 @@ if __name__ == "__main__": ...@@ -134,8 +130,6 @@ if __name__ == "__main__":
for i in time_list: for i in time_list:
#time.sleep(random.randint(3000,4500))
numtime = time_conv(i) numtime = time_conv(i)
user_id = get_data(numtime) user_id = get_data(numtime)
...@@ -161,7 +155,7 @@ if __name__ == "__main__": ...@@ -161,7 +155,7 @@ if __name__ == "__main__":
for i in range(urge_num): for i in range(urge_num):
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cook=login() cook=login()
......
...@@ -30,8 +30,6 @@ def get_majia(): ...@@ -30,8 +30,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -45,9 +43,6 @@ def get_majia(): ...@@ -45,9 +43,6 @@ def get_majia():
def logins(): def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
...@@ -155,7 +150,7 @@ if __name__ == "__main__": ...@@ -155,7 +150,7 @@ if __name__ == "__main__":
for i in range(urge_num): for i in range(urge_num):
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cook=logins() cook=logins()
......
...@@ -33,8 +33,6 @@ def get_majia(): ...@@ -33,8 +33,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -49,8 +47,6 @@ def logins(): ...@@ -49,8 +47,6 @@ def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id = get_majia() user_id = get_majia()
cookies = index_first() cookies = index_first()
...@@ -151,7 +147,7 @@ if __name__ == "__main__": ...@@ -151,7 +147,7 @@ if __name__ == "__main__":
for i in topic_id: for i in topic_id:
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cook = logins() cook = logins()
......
...@@ -32,8 +32,6 @@ def get_majia(): ...@@ -32,8 +32,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
......
...@@ -30,8 +30,6 @@ def get_majia(): ...@@ -30,8 +30,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -46,8 +44,6 @@ def logins(): ...@@ -46,8 +44,6 @@ def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
...@@ -144,7 +140,7 @@ if __name__ == "__main__": ...@@ -144,7 +140,7 @@ if __name__ == "__main__":
for i in range(follow_num): for i in range(follow_num):
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cookies=logins() cookies=logins()
......
...@@ -33,8 +33,6 @@ def get_majia(): ...@@ -33,8 +33,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -48,8 +46,6 @@ def get_majia(): ...@@ -48,8 +46,6 @@ def get_majia():
def logins(user_id): def logins(user_id):
try: try:
# time.sleep(random.randint(300, 500))
cookies = index_first() cookies = index_first()
post_dict = { post_dict = {
...@@ -167,7 +163,7 @@ if __name__ == "__main__": ...@@ -167,7 +163,7 @@ if __name__ == "__main__":
for i in value: for i in value:
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cookies=logins(id) cookies=logins(id)
......
...@@ -30,8 +30,6 @@ def get_majia(): ...@@ -30,8 +30,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -46,8 +44,6 @@ def logins(): ...@@ -46,8 +44,6 @@ def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
...@@ -120,13 +116,13 @@ def get_commnet_id(numtime): ...@@ -120,13 +116,13 @@ def get_commnet_id(numtime):
cursor.execute( cursor.execute(
"SELECT t.user_id from topic t left join reply r on r.topic_id = t.id WHERE create_time LIKE '%%%%%s%%%%'" % numtime) "SELECT t.user_id from topic t left join reply r on r.topic_id = t.id WHERE r.create_time LIKE '%%%%%s%%%%'" % numtime)
data_reply_topic = cursor.fetchall() data_reply_topic = cursor.fetchall()
cursor.execute( cursor.execute(
"SELECT r.user_id from reply r left join reply p on .replied_id = p.replied_id WHERE create_time LIKE '%%%%%s%%%%'" % numtime) "SELECT r.user_id from reply r left join reply p on r.replied_id = p.replied_id WHERE p.create_time LIKE '%%%%%s%%%%'" % numtime)
data_reply_reply = cursor.fetchall() data_reply_reply = cursor.fetchall()
...@@ -190,7 +186,7 @@ if __name__ == "__main__": ...@@ -190,7 +186,7 @@ if __name__ == "__main__":
for i in range(follow_num): for i in range(follow_num):
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cookies = logins() cookies = logins()
......
...@@ -31,8 +31,6 @@ def get_majia(): ...@@ -31,8 +31,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -47,8 +45,6 @@ def logins(): ...@@ -47,8 +45,6 @@ def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
...@@ -111,7 +107,7 @@ def get_data(numtime): ...@@ -111,7 +107,7 @@ def get_data(numtime):
db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123', db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123',
db="alpha", port=3306) db="alpha", port=3306)
cursor = db.cursor() cursor = db.cursor()
cursor.execute("select user_id from account_user_auth where user_id not in (select user_id from pv_maidian where page_num='home' and partiton_date >= %s )" ,(numtime)) cursor.execute("select user_id from account_user_auth where user_id not in (select user_id from pv_maidian where page_name ='home' and partiton_date >= %s )" ,(numtime))
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
logging.info("Database version : %s " % user_id) logging.info("Database version : %s " % user_id)
...@@ -135,7 +131,7 @@ if __name__ == "__main__": ...@@ -135,7 +131,7 @@ if __name__ == "__main__":
cookies = index_first() cookies = index_first()
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cook=logins() cook=logins()
......
...@@ -30,8 +30,6 @@ def get_majia(): ...@@ -30,8 +30,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -45,9 +43,6 @@ def get_majia(): ...@@ -45,9 +43,6 @@ def get_majia():
def logins(): def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
...@@ -111,10 +106,10 @@ def get_data(numtime): ...@@ -111,10 +106,10 @@ def get_data(numtime):
db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123', db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123',
db="alpha", port=3306) db="alpha", port=3306)
cursor = db.cursor() cursor = db.cursor()
cursor.execute("select user_id from pv_maidian where page_num='home' and partiton_date like '%%%%%s%%%%' " % numtime) cursor.execute("select user_id from pv_maidian where page_name ='home' and partiton_date like '%%%%%s%%%%' " % numtime)
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
logging.info("Database version : %s " % data) logging.info("Database version : %s " % user_id)
db.close() db.close()
return user_id return user_id
except: except:
...@@ -123,9 +118,6 @@ def get_data(numtime): ...@@ -123,9 +118,6 @@ def get_data(numtime):
if __name__ == "__main__": if __name__ == "__main__":
try: try:
#time.sleep(random.randint(3000,4500))
numtime = time_conv(1) numtime = time_conv(1)
user_id = get_data(numtime) user_id = get_data(numtime)
......
...@@ -33,8 +33,6 @@ def get_majia(): ...@@ -33,8 +33,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -49,8 +47,6 @@ def logins(): ...@@ -49,8 +47,6 @@ def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
...@@ -200,7 +196,7 @@ if __name__ == "__main__": ...@@ -200,7 +196,7 @@ if __name__ == "__main__":
for i in range(urge_num): for i in range(urge_num):
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cookies = logins() cookies = logins()
......
...@@ -29,9 +29,8 @@ def get_majia(): ...@@ -29,9 +29,8 @@ def get_majia():
list=[] list=[]
for i in data: for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500)) list.append(i.strip('\n').strip(','))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
...@@ -46,7 +45,6 @@ def get_majia(): ...@@ -46,7 +45,6 @@ def get_majia():
def logins(): def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
...@@ -143,7 +141,7 @@ if __name__ == "__main__": ...@@ -143,7 +141,7 @@ if __name__ == "__main__":
for i in range(1): for i in range(1):
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cookies = logins() cookies = logins()
...@@ -151,7 +149,5 @@ if __name__ == "__main__": ...@@ -151,7 +149,5 @@ if __name__ == "__main__":
Urge(cookies, id) Urge(cookies, id)
# time.sleep(random.randint(500, 1000))
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
\ No newline at end of file
...@@ -31,8 +31,6 @@ def get_majia(): ...@@ -31,8 +31,6 @@ def get_majia():
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1,len(list)) maj = random.randint(1,len(list))
user_id=list[maj-1] user_id=list[maj-1]
...@@ -178,7 +176,7 @@ if __name__ == "__main__": ...@@ -178,7 +176,7 @@ if __name__ == "__main__":
for i in range(1): for i in range(1):
time.sleep(random.randint(10, 50)) # time.sleep(random.randint(10, 50))
cookies = logins() cookies = logins()
......
...@@ -43,7 +43,7 @@ def get_majia(): ...@@ -43,7 +43,7 @@ def get_majia():
def logins(): def logins():
try: try:
# time.sleep(random.randint(300, 500))
user_id=get_majia() user_id=get_majia()
cookies = index_first() cookies = index_first()
post_dict={ post_dict={
...@@ -97,7 +97,7 @@ def get_data(numtime): ...@@ -97,7 +97,7 @@ def get_data(numtime):
db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123', db = pymysql.connect(host="rm-2ze5k2we69904787l.mysql.rds.aliyuncs.com", user='work', passwd='Gengmei123',
db="alpha", port=3306) db="alpha", port=3306)
cursor = db.cursor() cursor = db.cursor()
cursor.execute("select user_id from account_user_auth where user_id not in (select user_id from pv_maidian where page_num='home' and partiton_date >= %s) ", (numtime)) cursor.execute("select user_id from account_user_auth where user_id not in (select user_id from pv_maidian where page_name ='home' and partiton_date >= %s) ", (numtime))
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
logging.info("Database version : %s " % user_id) logging.info("Database version : %s " % user_id)
......
...@@ -23,4 +23,4 @@ s_zTD7tV@shadow.com ...@@ -23,4 +23,4 @@ s_zTD7tV@shadow.com
s_zTgGjF@shadow.com s_zTgGjF@shadow.com
s_ZVuLyC@shadow.com s_ZVuLyC@shadow.com
s_ZVyOE2@shadow.com s_ZVyOE2@shadow.com
s_ZVuLyC@shadow.com
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