Commit 03b8b56d authored by lixiaofang's avatar lixiaofang

add

parent 56ec950d
...@@ -16,7 +16,7 @@ from vest.fix import fix_no_comment_click ...@@ -16,7 +16,7 @@ from vest.fix import fix_no_comment_click
from vest.reply_answer import reply_comment2, reply_comment3, answer_reply2, answer_reply3, answer_reply1 from vest.reply_answer import reply_comment2, reply_comment3, answer_reply2, answer_reply3, answer_reply1
from vest.request import get_session, auto_user_id from vest.request import get_session, auto_user_id
from vest.vest_majiauser import vest_click_reply from vest.vest_majiauser import vest_click_reply
from vest.pictorial import principal_offline_comment1, principal_online_comment1 from vest.pictorial import principal_offline_comment1, principal_online_comment1,no_reply_principal
class Command(BaseCommand): class Command(BaseCommand):
...@@ -143,5 +143,9 @@ class Command(BaseCommand): ...@@ -143,5 +143,9 @@ class Command(BaseCommand):
if options["mvest"] == "principal_online_comment1": if options["mvest"] == "principal_online_comment1":
principal_online_comment1.principal_online_comment1() principal_online_comment1.principal_online_comment1()
if options["mvest"] == "no_reply_principal":
no_reply_principal.no_reply_principal()
except: except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
import pymysql
import random
import traceback
import logging
from vest.request.auto_request import logins, pictorial_reply, get_majia_reply, get_pictorial_comment
from vest.request.auto_request import host, user, db, passwd
"""
离线一次性插入{1,4}条评论
"""
def get_data():
try:
print("....")
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"select id from community_pictorial where id not in (select pictorial_id from reply group by pictorial_id)")
data = cursor.fetchall()
topic_id = list(data)
logging.info("Database version : %s " % topic_id)
return topic_id
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
def no_reply_principal():
try:
logging.info("comment offline pictorial")
user_id = get_data()
dicts = {}
for i in user_id:
for num in range(4):
majia_user_id = get_majia_reply(i[0])
cook = logins(majia_user_id)
comment = get_pictorial_comment()
if cook is not None:
logging.info("get cook:%s" % cook)
logging.info("get i[1]:%s" % i[1])
logging.info("get comment:%s" % comment)
pictorial_reply(cook, i[1], comment)
else:
logging.info("no get cookies-------------")
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
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