Commit 477fb158 authored by lixiaofang's avatar lixiaofang

add

parent 6c7180e2
This diff is collapsed.
......@@ -7,7 +7,7 @@ import pandas as pd
import traceback
from log_settings import *
import logging
from auto_request import get_offline_comment
from auto_request import get_offline_comment
from auto_request import host, user, db, passwd
auto_reply_url = "http://47.93.162.11:8085/api/v1/reply/create_for_inner"
......@@ -39,13 +39,12 @@ def reply(id, content, user_id):
logging.error("catch exception,logins:%s" % traceback.format_exc())
def get_data(numtime, numtime2):
def get_data(num1,num2):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT id,user_id FROM topic WHERE is_online =1 and (create_time < %s and create_time > %s) and (content_level = 4 or content_level = 5) and user_id in (select user_id from user_extra where is_shadow = 1)",
(numtime, numtime2))
"SELECT id,user_id FROM topic WHERE is_online =1 and (id > "+str(num1)+" and id <= "+str(num2)+") and (content_level = 4 or content_level = 5) and user_id in (select user_id from user_extra where is_shadow = 1)")
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % user_id)
......@@ -60,9 +59,9 @@ if __name__ == "__main__":
try:
time_list = [["2011-03-30 15:57:49.000000", "2010-03-30 15:57:49.000000"]]
# ["2015-03-30 15:57:49.000000", "2012-03-30 15:57:49.000000"],
# ["2016-03-30 15:57:49.000000", "2015-03-30 15:57:49.000000"],
time_list = [[0, 10000],[10000,20000]]
# [10000, 20000],
# [20000, 30000],
# ["2017-03-30 15:57:49.000000", "2016-03-30 15:57:49.000000"],
# ["2018-03-30 15:57:49.000000", "2017-03-30 15:57:49.000000"],
# ["2019-03-30 15:57:49.000000", "2018-03-30 15:57:49.000000"]]
......@@ -72,7 +71,6 @@ if __name__ == "__main__":
user_list = []
for i in user_data.readlines():
user_list.append(i)
for i in time_list:
......@@ -92,7 +90,6 @@ if __name__ == "__main__":
user_id = user_list[num]
if user_id != id[1]:
comment_list = get_offline_comment()
comment = comment_list[i]
......
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