Commit dc78a2b3 authored by lixiaofang's avatar lixiaofang

majia new

parent e5694945
This diff is collapsed.
......@@ -29,7 +29,7 @@ def get_majia():
maj = random.randint(1,len(list))
user_id=list[maj]
user_id=list[maj-1]
return user_id
......@@ -125,8 +125,8 @@ def reply(cookies_get,id,content):
def time_conv():
now = datetime.datetime.now()
yes_time_str=now.strftime('%Y-%m-%d')
return yes_time_str
yes_time = now - datetime.timedelta(minutes=15)
return yes_time
def get_topic_id(numtime):
......@@ -134,7 +134,7 @@ def get_topic_id(numtime):
db="alpha", port=3306)
cursor = db.cursor()
print("---------")
cursor.execute("SELECT id FROM topic WHERE create_time LIKE '%%%%%s%%%%'" % numtime)
cursor.execute("SELECT id FROM topic WHERE create_time <= %s" ,(numtime))
data = cursor.fetchall()
user_id = list(data)
......@@ -178,6 +178,11 @@ if __name__ == "__main__":
click(cookies, id)
# time.sleep(random.randint(500, 1500))
topic_id = get_topic_id(numtime)
for j in topic_id:
id = int(j[0])
comment_num = random.randint(1, 3)
......@@ -191,30 +196,3 @@ if __name__ == "__main__":
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)
......@@ -25,12 +25,6 @@ def get_majia():
for i in data:
list.append(i.strip('\n').strip(','))
# time.sleep(random.randint(0, 500))
maj = random.randint(1, len(list))
user_id=list[maj-1]
return list
def logins(id):
......@@ -82,10 +76,14 @@ def get_follw_majia(numtime,id):
cursor = db.cursor()
print("---------")
cursor.execute("SELECT user_id,follow_id FROM user_follow WHERE create_time <= '%s' ",(numtime))
cursor.execute("select temp1.user_id,temp1.email ,temp2.follow_id from account_user_auth temp1 left join "
"(select user_id,follow_id from user_follow) "
" temp2 on temp1.user_id=temp2.user_id where temp1.user_id in %s ",('s_05tmwu@shadow.com','s_07CRHt@shadow.com','s_0bdxxU@shadow.com','s_0mfxcO@shadow.com','s_0u6eaV@shadow.com','s_0UudEr@shadow.com','s_1b3v5V@shadow.com','s_1dbAoA@shadow.com','s_1dholX@shadow.com','s_1EpLlt@shadow.com','s_1iyrBU@shadow.com'))
data = cursor.fetchall()
data=list(data)
print("Database version : %s " % data)
db.close()
......
......@@ -22,4 +22,5 @@ s_3Do04x@shadow.com
s_zTD7tV@shadow.com
s_zTgGjF@shadow.com
s_ZVuLyC@shadow.com
s_ZVyOE2@shadow.com
\ No newline at end of file
s_ZVyOE2@shadow.com
......@@ -23,10 +23,15 @@
#
# print(get_majia())
data = open("batch user gen")
list=[1,23,4,5]
list = []
for i in data:
list.append(i.strip('\n').strip(','))
x= 5
print(list)
if x in list:
print(x)
\ No newline at end of file
l = 's_0bdxxU@shadow.com'
if l in list:
print(l)
\ 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