Commit 853a9447 authored by lixiaofang's avatar lixiaofang

add

parent 2d0e5c57
......@@ -7,8 +7,9 @@ import traceback
import logging
from libs.es import ESPerform
from trans2es.type_info import get_type_info_map, TypeInfo
from vest.reply import true_comment_one, true_comment_two, true_comment_three
from vest.click import true_click_five, true_click_two, true_click_four, true_click_one, true_click_three
from vest.reply import true_comment_one, true_comment_two, true_comment_three,one_seven_topic_comment
from vest.click import true_click_five, true_click_two, true_click_four, true_click_one, true_click_three, \
one_seven_star_topic
from vest.follow import auto_follow, auto_follow_new
from vest.urge import auto_star_urge, auto_lunch_app, auto_lunch_app2, auto_urge1, auto_urge2
from vest.fix import fix_no_comment_click
......@@ -79,6 +80,8 @@ class Command(BaseCommand):
true_click_four.true_click_four()
if options["mvest"] == "true_click_five":
true_click_five.true_click_five()
if options["mvest"] == "one_seven_star_topic":
one_seven_star_topic.one_seven_star_topic()
# 评论
if options["mvest"] == "true_comment_one":
......@@ -87,6 +90,8 @@ class Command(BaseCommand):
true_comment_two.true_comment_two()
if options["mvest"] == "true_comment_three":
true_comment_three.true_comment_three()
if options["mvest"] == "one_seven_topic_comment":
one_seven_topic_comment.one_seven_topic_comment()
# 催更
if options["mvest"] == "auto_urge1":
......
import time
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, click, time_convs
from auto_request import host, user, db, passwd
def get_data(numtime, numtime2):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and content_level in (4,5,6) and (create_time >= '%s' and create_time <= '%s')" % (
numtime, numtime2))
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
for i in topic_id and topic_id:
cursor.execute(
"select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall()
user_id = list(data)
if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
def one_seven_star_topic():
try:
numtime, numtime2 = time_convs(1, 7)
user_id = get_data(numtime, numtime2)
dicts = {}
logging.info("get user_id:%s" % user_id)
for i in user_id:
rand_num = random.randint(0, 1)
if rand_num == 1:
cook = login()
if cook is not None:
click(cook, i[1])
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import time
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, click, time_convs
from auto_request import host, user, db, passwd
def get_data(numtime, numtime2):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT distinct(user_id) FROM topic WHERE is_online=1 and (create_time >= '%s' and create_time <= '%s')" % (
numtime, numtime2))
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
for i in topic_id and topic_id:
cursor.execute(
"select user_id,is_shadow from user_extra where user_id =" + str(
i[0]) + " and is_online =1 and is_deleted =0")
data = cursor.fetchall()
user_id = list(data)
if (user_id and user_id[0][1] == 0) or len(user_id) == 0:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
def one_seven_topic_comment():
try:
numtime, numtime2 = time_convs(1, 7)
user_id = get_data(numtime, numtime2)
logging.info("get user_id:%s" % user_id)
for i in user_id:
cook = login()
if cook is not None:
click(cook, i[1])
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