Commit c3280c45 authored by lixiaofang's avatar lixiaofang

add

parent f9d86870
This diff is collapsed.
...@@ -4,25 +4,26 @@ import random ...@@ -4,25 +4,26 @@ 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_convs, get_user_id from auto_request import login, click, time_convs
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_data(numtime): def get_data(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT user_id , id FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%'" % numtime) "SELECT user_id,id FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall() data = cursor.fetchall()
topic_id = list(data) topic_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if topic_id: for i in topic_id:
for i in topic_id: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
return topic_id_list return topic_id_list
......
...@@ -5,8 +5,8 @@ import pymysql ...@@ -5,8 +5,8 @@ import pymysql
import random import random
import traceback import traceback
import logging import logging
from auto_request import login, click, time_convs, get_user_id from auto_request import login, click, time_convs
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_data(numtime): def get_data(numtime):
...@@ -15,16 +15,17 @@ def get_data(numtime): ...@@ -15,16 +15,17 @@ def get_data(numtime):
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%' " % numtime) "SELECT user_id , id FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%' " % numtime)
data = cursor.fetchall() data = cursor.fetchall()
topic_id = list(data) topic_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if topic_id: for i in topic_id:
for i in topic_id: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
return topic_id_list return topic_id_list
......
...@@ -7,8 +7,8 @@ import traceback ...@@ -7,8 +7,8 @@ import traceback
import logging import logging
from log_settings import * from log_settings import *
from auto_request import login, time_convs, reply, get_comment, get_user_id from auto_request import login, time_convs, reply, get_comment
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_topic_id(numtime): def get_topic_id(numtime):
...@@ -16,19 +16,19 @@ def get_topic_id(numtime): ...@@ -16,19 +16,19 @@ def get_topic_id(numtime):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT user_id,id FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%' " % numtime "SELECT id,user_id FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%' " % numtime
# "select id,user_id from topic where user_id = 241529801 or id = 241529809"
) )
data = cursor.fetchall() data = cursor.fetchall()
topic_id = list(data) topic_id = list(data)
logging.info("Database version : %s " % topic_id) logging.info("Database version : %s " % topic_id)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if topic_id: for i in topic_id:
for i in topic_id: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[1]) + " and is_shadow =0 ")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -24,17 +24,22 @@ def get_topic_new_user(numtime): ...@@ -24,17 +24,22 @@ def get_topic_new_user(numtime):
topic_data = list(topic_data) topic_data = list(topic_data)
new_user_data = list(new_user_data) new_user_data = list(new_user_data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if topic_data: for i in topic_data:
for i in topic_data: cursor.execute(
if int(i) in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if new_user_data: if user_id:
for i in new_user_data: topic_id_list.append(i)
if i in user_list:
topic_id_list.append(i) for i in new_user_data:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -6,27 +6,26 @@ import random ...@@ -6,27 +6,26 @@ import random
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, time_convs, follow,get_user_id from auto_request import login, time_convs, follow
from auto_request import host, user, port, db, passwd from auto_request import host, user, port, db, passwd
def get_data(numtime): def get_data(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%'" % numtime) "SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if user_id: for i in user_id:
for i in user_id: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
topic_id_list.append(i) data = cursor.fetchall()
id = list(data)
if id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
return topic_id_list return topic_id_list
...@@ -62,10 +61,8 @@ if __name__ == "__main__": ...@@ -62,10 +61,8 @@ if __name__ == "__main__":
cookies = login() cookies = login()
if cookies is not None: if cookies is not None:
follow(cookies, id) follow(cookies, id)
time.sleep(300) time.sleep(300)
except: except:
logging.error("catch exception,main:%s" % traceback.format_exc()) logging.error("catch exception,main:%s" % traceback.format_exc())
...@@ -6,12 +6,12 @@ import random ...@@ -6,12 +6,12 @@ import random
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, time_convs, follow, get_user_id from auto_request import login, time_convs, follow
from auto_request import host, user, port, db, passwd from auto_request import host, user, port, db, passwd
def get_commnet_id(numtime): def get_commnet_id(numtime):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
...@@ -47,41 +47,62 @@ def get_commnet_id(numtime): ...@@ -47,41 +47,62 @@ def get_commnet_id(numtime):
data1_id = list(data_reply_topic) data1_id = list(data_reply_topic)
data2_id = list(data_group_follow) data2_id = list(data_group_follow)
data3_id = list(data_new_user) data3_id = list(data_new_user)
data_reply_reply = list(data_reply_reply) data_reply = list(data_reply_reply)
user_list = get_user_id()
user_id = []
topic_id_list = []
for i in data_id: for i in data_id:
if i[0] is not None: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
user_id.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data1_id: for i in data1_id:
if i[0] is not None: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
user_id.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data2_id: for i in data2_id:
if i[0] is not None: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
user_id.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data3_id: for i in data3_id:
if i[0] is not None: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
user_id.append(i) data = cursor.fetchall()
user_id = list(data)
for i in data_reply_reply: if user_id:
if i[0] is not None: topic_id_list.append(i)
if int(i[0]) not in user_list:
user_id.append(i)
logging.info("Database version : %s " % user_id) for i in data1_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data_reply:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
return user_id return topic_id_list
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -6,13 +6,13 @@ import random ...@@ -6,13 +6,13 @@ import random
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, time_conv, follow, get_cookies, get_user_id from auto_request import login, time_conv, follow, get_cookies
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_data(numtime): def get_data(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"select distinct(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 )", "select distinct(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 )",
...@@ -20,12 +20,14 @@ def get_data(numtime): ...@@ -20,12 +20,14 @@ def get_data(numtime):
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if user_id: for i in user_id:
for i in user_id: cursor.execute(
if int(i) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -6,24 +6,27 @@ import random ...@@ -6,24 +6,27 @@ import random
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, time_convs, follow, get_user_id from auto_request import login, time_convs, follow
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_data(numtime): def get_data(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"select distinct(user_id) from pv_maidian where page_name ='home' and partiton_date like '%%%%%s%%%%'" % numtime) "select distinct(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)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if user_id: for i in user_id:
for i in user_id: cursor.execute(
if int(i) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.pcinfo("Database version : %s " % topic_id_list) logging.pcinfo("Database version : %s " % topic_id_list)
pc.close() pc.close()
return topic_id_list return topic_id_list
......
...@@ -132,7 +132,6 @@ def time_conv(minutest): ...@@ -132,7 +132,6 @@ def time_conv(minutest):
try: try:
now = datetime.datetime.now() now = datetime.datetime.now()
yes_time = now - datetime.timedelta(minutes=minutest) yes_time = now - datetime.timedelta(minutes=minutest)
print(yes_time)
return yes_time return yes_time
except: except:
...@@ -144,7 +143,7 @@ def time_convs(numtime): ...@@ -144,7 +143,7 @@ def time_convs(numtime):
now = datetime.datetime.now() now = datetime.datetime.now()
yes_time = now - datetime.timedelta(days=numtime) yes_time = now - datetime.timedelta(days=numtime)
yes_time_str = yes_time.strftime('%Y-%m-%d') yes_time_str = yes_time.strftime('%Y-%m-%d')
return yes_time_str return yes_time
except: except:
return None return None
......
...@@ -6,26 +6,26 @@ import random ...@@ -6,26 +6,26 @@ import random
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, time_conv, follow, click, get_user_id from auto_request import login, time_conv, follow, click
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_star_user_id(numtime): def get_star_user_id(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT user_id,id FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time LIKE '%%%%%s%%%%' " % numtime) "SELECT user_id,id FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time LIKE '%%%%%s%%%%' " % numtime)
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if user_id: for i in user_id:
for i in user_id: cursor.execute(
if int(i[0]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
return topic_id_list return topic_id_list
......
...@@ -7,26 +7,26 @@ import pandas as pd ...@@ -7,26 +7,26 @@ import pandas as pd
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, time_conv, Urge, get_user_id from auto_request import login, time_conv, Urge
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_star_useid(numtime): def get_star_useid(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time LIKE '%%%%%s%%%%'" % numtime) "SELECT distinct(user_id) FROM topic WHERE is_online=1 and (content_level =4 or content_level =5) and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if user_id: for i in user_id:
for i in user_id: cursor.execute(
if int(i) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
return topic_id_list return topic_id_list
...@@ -58,7 +58,6 @@ if __name__ == "__main__": ...@@ -58,7 +58,6 @@ if __name__ == "__main__":
cookies = login() cookies = login()
if cookies is not None: if cookies is not None:
Urge(cookies, id) Urge(cookies, id)
except: except:
......
...@@ -7,26 +7,28 @@ import pandas as pd ...@@ -7,26 +7,28 @@ import pandas as pd
import traceback import traceback
from log_settings import * from log_settings import *
import logging import logging
from auto_request import login, time_conv, Urge, get_user_id from auto_request import login, time_conv, Urge
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
import threading import threading
def get_data(numtime): def get_data(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%'" % numtime) "SELECT distinct(user_id) FROM topic WHERE is_online=1 and create_time LIKE '%%%%%s%%%%'" % numtime)
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if user_id: for i in user_id:
for i in user_id: cursor.execute(
if int(i) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -8,26 +8,27 @@ from log_settings import * ...@@ -8,26 +8,27 @@ from log_settings import *
import logging import logging
import threading import threading
from auto_request import login, time_conv, Urge, get_user_id from auto_request import login, time_conv, Urge
from auto_request import host, user, port, db, passwd from auto_request import host, user, db, passwd
def get_data(numtime): def get_data(numtime):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=port) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
cursor.execute( cursor.execute(
"select distinct(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)", "select distinct(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)) (numtime))
data = cursor.fetchall() data = cursor.fetchall()
user_id = list(data) user_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if user_id: for i in user_id:
for i in user_id: cursor.execute(
if int(i[1]) not in user_list: "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
topic_id_list.append(i) data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list) logging.info("Database version : %s " % topic_id_list)
pc.close() pc.close()
......
...@@ -35,3 +35,4 @@ for i in data: ...@@ -35,3 +35,4 @@ for i in data:
...@@ -43,7 +43,7 @@ if __name__ == "__main__": ...@@ -43,7 +43,7 @@ if __name__ == "__main__":
global exec_count global exec_count
exec_count += 1 exec_count += 1
if exec_count == 1: if exec_count == 2:
print("----1------") print("----1------")
sleep_time = random.randint(300, 540) sleep_time = random.randint(300, 540)
sleep_time = 30 sleep_time = 30
...@@ -76,7 +76,7 @@ if __name__ == "__main__": ...@@ -76,7 +76,7 @@ if __name__ == "__main__":
timer = threading.Timer(sleep_time, fun_timer) timer = threading.Timer(sleep_time, fun_timer)
timer.start() timer.start()
if exec_count == 2: if exec_count == 5:
print("----4------") print("----4------")
# sleep_time = random.randint(1000, 1900) # sleep_time = random.randint(1000, 1900)
......
...@@ -4,7 +4,7 @@ import random ...@@ -4,7 +4,7 @@ import random
from log_settings import * from log_settings import *
import traceback import traceback
import logging import logging
from auto_request import get_offline_comment,get_user_id from auto_request import get_offline_comment
from auto_request import host, user, db, passwd from auto_request import host, user, db, passwd
auto_reply_url = "http://47.93.162.11:8085/api/v1/reply/create_for_inner" auto_reply_url = "http://47.93.162.11:8085/api/v1/reply/create_for_inner"
...@@ -19,8 +19,6 @@ auto_reply_url = "http://47.93.162.11:8085/api/v1/reply/create_for_inner" ...@@ -19,8 +19,6 @@ auto_reply_url = "http://47.93.162.11:8085/api/v1/reply/create_for_inner"
# 注意需要禁止本帖作者评论 # 注意需要禁止本帖作者评论
def reply(id, content, user_id): def reply(id, content, user_id):
try: try:
post_dict = { post_dict = {
...@@ -42,20 +40,19 @@ def get_data(num1, num2): ...@@ -42,20 +40,19 @@ def get_data(num1, num2):
try: try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306) pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor() cursor = pc.cursor()
print(num1)
print(num2)
print("--------")
cursor.execute( cursor.execute(
"SELECT id,user_id FROM topic WHERE is_online =1 and (id > " + str(num1) + " and id <= " + str( "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) ") num2) + ") and (content_level = 4 or content_level = 5) ")
data = cursor.fetchall() data = cursor.fetchall()
topic_id = list(data) topic_id = list(data)
user_list = get_user_id()
topic_id_list = [] topic_id_list = []
if topic_id: for i in topic_id:
for i in topic_id: cursor.execute(
if int(i[1]) in user_list: "select user_id from user_extra where user_id =" + str(i[1]) + " and is_shadow =1")
topic_id_list.append(i) cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
pc.close() pc.close()
logging.info("get topic_id_list:%s" % topic_id_list) logging.info("get topic_id_list:%s" % topic_id_list)
return topic_id_list return topic_id_list
...@@ -68,7 +65,8 @@ if __name__ == "__main__": ...@@ -68,7 +65,8 @@ if __name__ == "__main__":
try: try:
time_list = [[0, 100000], [100000, 200000], [200000, 300000], [300000, 400000], [400000, 500000],[500000, 600000],[600000, 700000]] time_list = [[0, 100000], [100000, 200000], [200000, 300000], [300000, 400000], [400000, 500000],
[500000, 600000], [600000, 700000]]
user_data = open("user_id.txt", "r") user_data = open("user_id.txt", "r")
......
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