Commit ff173e40 authored by lixiaofang's avatar lixiaofang

add

parent 22e1d414
......@@ -16,7 +16,9 @@ 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.request import get_session, auto_user_id
from vest.vest_majiauser import vest_click_reply
from vest.pictorial import principal_offline_comment1, principal_online_comment1,no_reply_principal
from vest.pictorial import principal_offline_comment1, principal_online_comment1, no_reply_principal
from vest.change_reply import yesterday_topic_reply, before_yesterday_topic_reply, seven_days_ago_reply, \
three_days_ago_topic_reply, five_days_ago_topic_reply
class Command(BaseCommand):
......@@ -146,6 +148,22 @@ class Command(BaseCommand):
if options["mvest"] == "no_reply_principal":
no_reply_principal.no_reply_principal()
### 修改评论
if options["mvest"] == "yesterday_topic_reply":
yesterday_topic_reply.yesterday_comment_one()
if options["mvest"] == "before_yesterday_topic_reply":
before_yesterday_topic_reply.before_yesterday_comment_one()
if options["mvest"] == "three_days_ago_topic_reply":
three_days_ago_topic_reply.three_days_ago_comment_one()
if options["mvest"] == "five_days_ago_topic_reply":
five_days_ago_topic_reply.five_days_ago_comment_one()
if options["mvest"] == "seven_days_ago_reply":
seven_days_ago_reply.serven_days_ago_comment_one()
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
......@@ -16,8 +16,8 @@ def get_data(numtime, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id,id FROM topic WHERE (create_time > '%s' and create_time < '%s' ) and is_online=1 " % (
numtime, numtime2))
"SELECT user_id,id FROM topic WHERE (create_time >= '%s' and create_time <= '%s' ) and is_online=1 " % (
numtime2, numtime))
data = cursor.fetchall()
topic_id_list = list(data)
return topic_id_list
......@@ -30,7 +30,7 @@ def get_data(numtime, numtime2):
def before_yesterday_comment_one():
try:
logging.info("comment one")
numtime, numtime2 = time_convs(2, 1)
numtime, numtime2 = time_convs(2, 2)
topic_id_list = get_data(numtime, numtime2)
if topic_id_list:
for i in topic_id_list:
......
......@@ -16,8 +16,8 @@ def get_data(numtime, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id,id FROM topic WHERE (create_time > '%s' and create_time < '%s' ) and is_online=1 " % (
numtime, numtime2))
"SELECT user_id,id FROM topic WHERE (create_time >= '%s' and create_time <= '%s' ) and is_online=1 " % (
numtime2, numtime))
data = cursor.fetchall()
topic_id_list = list(data)
return topic_id_list
......@@ -30,7 +30,7 @@ def get_data(numtime, numtime2):
def five_days_ago_comment_one():
try:
logging.info("comment one")
numtime, numtime2 = time_convs(5, 1)
numtime, numtime2 = time_convs(5, 5)
topic_id_list = get_data(numtime, numtime2)
if topic_id_list:
for i in topic_id_list:
......
......@@ -16,8 +16,8 @@ def get_data(numtime, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id,id FROM topic WHERE (create_time > '%s' and create_time < '%s' ) and is_online=1 " % (
numtime, numtime2))
"SELECT user_id,id FROM topic WHERE (create_time >= '%s' and create_time <= '%s' ) and is_online=1 " % (
numtime2, numtime))
data = cursor.fetchall()
topic_id_list = list(data)
return topic_id_list
......@@ -30,7 +30,7 @@ def get_data(numtime, numtime2):
def serven_days_ago_comment_one():
try:
logging.info("comment one")
numtime, numtime2 = time_convs(7, 1)
numtime, numtime2 = time_convs(7, 7)
topic_id_list = get_data(numtime, numtime2)
if topic_id_list:
for i in topic_id_list:
......
......@@ -16,8 +16,8 @@ def get_data(numtime, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id,id FROM topic WHERE (create_time > '%s' and create_time < '%s' ) and is_online=1 " % (
numtime, numtime2))
"SELECT user_id,id FROM topic WHERE (create_time >= '%s' and create_time <= '%s' ) and is_online=1 " % (
numtime2, numtime))
data = cursor.fetchall()
topic_id_list = list(data)
return topic_id_list
......@@ -30,7 +30,7 @@ def get_data(numtime, numtime2):
def three_days_ago_comment_one():
try:
logging.info("comment one")
numtime, numtime2 = time_convs(3, 1)
numtime, numtime2 = time_convs(3, 3)
topic_id_list = get_data(numtime, numtime2)
if topic_id_list:
for i in topic_id_list:
......
......@@ -16,8 +16,8 @@ def get_data(numtime, numtime2):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id,id FROM topic WHERE (create_time > '%s' and create_time < '%s' ) and is_online=1 " % (
numtime, numtime2))
"SELECT user_id,id FROM topic WHERE (create_time >= '%s' and create_time <= '%s' ) and is_online=1 " % (
numtime2, numtime))
data = cursor.fetchall()
topic_id_list = list(data)
return topic_id_list
......
......@@ -20,10 +20,10 @@ my_sender = 'lixiaofang@igengmei.com'
my_pass = 'tg5AVKBB8jLQGBET'
my_user6 = "lixiaofang@igengmei.com"
auto_click_url = settings.auto_click_url
auto_reply_url = settings.auto_reply_url
auto_follow_url = settings.auto_follow_url
auto_urge_url = settings.auto_urge_url
auto_click_url = settings.AUTO_CLICK_URL
auto_reply_url = settings.AUTO_REPLY_URL
auto_follow_url = settings.AUTO_FOLLOW_URL
auto_urge_url = settings.AUTO_URGE_URL
host = DATABASES['default']['HOST']
......
......@@ -9,7 +9,7 @@ from django.conf import settings
def index_first():
try:
r1 = requests.get(settings.login_url)
r1 = requests.get(settings.LOGIN_URL)
return r1.cookies.get_dict()
except:
logging.error("index_first:%s" % traceback.format_exc())
......@@ -31,7 +31,7 @@ def get_cook():
'email': i
}
response = requests.post(
url=settings.login_url,
url=settings.LOGIN_URL,
data=post_dict,
cookies=cookies
)
......
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