Commit af5cab0a authored by lixiaofang's avatar lixiaofang

add

parent fb5b3538
......@@ -4,6 +4,8 @@ import traceback
import logging
from vest.request.auto_request import login, click, time_conv
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
try:
......@@ -41,13 +43,12 @@ def true_click_five():
logging.info("click five")
numtime, numtime2 = time_conv(51, 41)
user_id = get_data(numtime, numtime2)
dicts = {}
for i in user_id:
rand_num = random.randint(0, 1)
if rand_num == 1:
cook = login()
if cook is not None:
# write_id_file(i[1])
click(cook, i[1])
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -4,6 +4,7 @@ import traceback
import logging
from vest.request.auto_request import login, click, time_conv
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -50,4 +51,5 @@ def true_click_four():
if cook is not None:
click(cook, i[1])
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
import time
import pymysql
import random
import traceback
import logging
from vest.request.auto_request import login, click, time_conv
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -40,7 +39,6 @@ def get_data(numtime, numtime2):
def true_click_one():
try:
numtime, numtime2 = time_conv(150, 0)
user_id = get_data(numtime, numtime2)
for i in user_id:
......@@ -48,6 +46,6 @@ def true_click_one():
logging.info("get cook:%s" % cook)
if cook is not None:
click(cook, i[1])
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
import time
import pymysql
import random
import traceback
import logging
from vest.request.auto_request import login, click, time_conv
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -43,7 +43,6 @@ def true_click_three():
logging.info("click three")
numtime, numtime2 = time_conv(45, 35)
user_id = get_data(numtime, numtime2)
dicts = {}
for i in user_id:
rand_num = random.randint(0, 1)
if rand_num == 1:
......@@ -51,4 +50,5 @@ def true_click_three():
if cook is not None:
click(cook, i[1])
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -5,6 +5,7 @@ import traceback
import logging
from vest.request.auto_request import login, click, time_conv
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -42,7 +43,6 @@ def true_click_two():
try:
numtime, numtime2 = time_conv(27, 17)
user_id = get_data(numtime, numtime2)
dicts = {}
for i in user_id:
rand_num = random.randint(0, 1)
if rand_num == 1:
......@@ -50,4 +50,5 @@ def true_click_two():
if cook is not None:
click(cook, i[1])
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
import logging
from vest.request.auto_request import login, time_convs, reply, get_comment, click
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_topic_id(numtime1, numtime2):
......@@ -41,5 +38,5 @@ def fix_no_comment_click():
reply(cook, i[0], comment)
except:
logging_exception()
logging.error("catch exception,main :%s" % traceback.format_exc())
......@@ -2,7 +2,8 @@ import pymysql
import traceback
import logging
from vest.request.auto_request import login, time_convs, follow
from vest.request.auto_request import host, user, port, db, passwd
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime1, numtime2):
......@@ -48,5 +49,5 @@ def auto_follow():
follow(cookies, id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
import time
import pymysql
import random
import traceback
import logging
from vest.request.auto_request import login, time_convs, follow
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_commnet_id(numtime):
......@@ -110,4 +110,5 @@ def auto_follow_new():
pass
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -3,6 +3,7 @@ import traceback
import logging
from vest.request.auto_request import login, time_conv, get_comment, reply
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -53,4 +54,5 @@ def true_comment_one():
else:
logging.error("catch exception,main:%s" % traceback.format_exc())
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -5,6 +5,7 @@ import traceback
import logging
from vest.request.auto_request import login, time_conv, get_comment, reply
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -57,4 +58,5 @@ def true_comment_three():
else:
logging.error("catch exception,main:%s" % traceback.format_exc())
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -4,6 +4,7 @@ import traceback
import logging
from vest.request.auto_request import login, time_conv, get_comment, reply
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -56,4 +57,5 @@ def true_comment_two():
else:
logging.error("catch exception,main:%s" % traceback.format_exc())
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -6,6 +6,7 @@ from vest.request.auto_request import time_conv_minute, get_answer_data, reply_a
reply2, logins, \
get_majia, get_majia_reply
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -80,4 +81,5 @@ def answer_reply1():
reply2(cook, item["topic_id"], item["answer"], item["id"])
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -5,6 +5,7 @@ import json
from vest.request.auto_request import logins, time_conv, get_answer_data, reply_answer, get_majia, \
set_reply_to_redis
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -65,4 +66,5 @@ def answer_reply2():
redis_client.set(redis_key, json.dumps(reply_data_comment))
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -4,6 +4,7 @@ import logging
import json
from vest.request.auto_request import logins, time_conv, get_answer_data, reply_answer, set_reply_to_redis, get_majia
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_data(numtime, numtime2):
......@@ -64,4 +65,5 @@ def answer_reply3():
redis_client.set(redis_key1, json.dumps(reply_data_comment))
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -2,6 +2,7 @@ import traceback
import logging
import json
from vest.request.auto_request import set_reply_to_redis, reply2, logins, get_majia_reply
from libs.error import logging_exception
def reply_comment2():
......@@ -17,4 +18,5 @@ def reply_comment2():
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -2,6 +2,7 @@ import traceback
import json
import logging
from vest.request.auto_request import set_reply_to_redis, reply2, logins, get_majia_reply
from libs.error import logging_exception
def reply_comment3():
......@@ -17,4 +18,5 @@ def reply_comment3():
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -3,7 +3,7 @@ import traceback
import logging
from vest.request.auto_request import host, user, db, passwd
from libs.cache import redis_client
import json
from libs.error import logging_exception
def get_data():
......@@ -43,4 +43,5 @@ def auto_user_id():
redis_client.set("get_user_id_data", data)
except:
logging_exception()
logging.error("index_first:%s" % traceback.format_exc())
......@@ -3,10 +3,12 @@ import traceback
import logging
import json
from libs.cache import redis_client
from libs.error import logging_exception
# login_url = "http://earth.iyanzhi.com/api/account/login_pwd"
login_url = "http://earth.gmapp.env/api/account/login_pwd"
def index_first():
try:
r1 = requests.get(login_url)
......@@ -54,7 +56,7 @@ def get_session():
session_key = "majia_login_session"
dicts = get_cook()
for key, value in dicts.items():
redis_client.hset(session_key, key,json.dumps(value))
redis_client.hset(session_key, key, json.dumps(value))
except:
logging_exception()
logging.error("index_first:%s" % traceback.format_exc())
......@@ -2,7 +2,8 @@ import pymysql
import traceback
import logging
from vest.request.auto_request import login, time_convs, Urge
from vest.request.auto_request import host, user, passwd
from vest.request.auto_request import host, user, passwd
from libs.error import logging_exception
def get_data(numtime):
......@@ -31,4 +32,5 @@ def auto_lunch_app():
if cook is not None:
Urge(cook, id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -4,6 +4,7 @@ import traceback
import logging
from vest.request.auto_request import login, time_convs, Urge
from vest.request.auto_request import host, user, passwd
from libs.error import logging_exception
def get_data(numtime):
......@@ -34,4 +35,5 @@ def auto_lunch_app2():
if cook is not None:
Urge(cook, id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -3,6 +3,7 @@ import traceback
import logging
from vest.request.auto_request import login, time_convs, Urge
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
def get_star_useid(numtime1, numtime2):
......@@ -43,4 +44,5 @@ def auto_star_urge():
Urge(cookies, id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
import logging
from vest.request.auto_request import login, time_convs, Urge
from vest.request.auto_request import host, port, passwd, user, db
import threading
from libs.error import logging_exception
def get_data(numtime1, numtime2):
......@@ -39,7 +36,6 @@ def get_data(numtime1, numtime2):
def auto_urge1():
try:
time_list = [1, 2, 3, 4, 5, 6, 7]
numtime1, numtime2 = time_convs(8, 0)
logging.info("get numtime1:%s" % numtime1)
logging.info("get numtime2:%s" % numtime2)
......@@ -48,9 +44,9 @@ def auto_urge1():
if urge_num == 1:
for j in user_id and user_id:
id = int(j[0])
# time.sleep(random.randint(10, 50))
cookies = login()
if cookies is not None:
Urge(cookies, id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -4,7 +4,7 @@ import traceback
import logging
from vest.request.auto_request import login, time_convs, Urge
from vest.request.auto_request import host, port, passwd, user, db
import threading
from libs.error import logging_exception
def get_data(numtime1, numtime2):
......@@ -36,7 +36,6 @@ def get_data(numtime1, numtime2):
def auto_urge2():
try:
time_list = [1, 2, 3, 4, 5, 6, 7]
numtime1, numtime2 = time_convs(8, 0)
logging.info("get numtime1:%s" % numtime1)
logging.info("get numtime2:%s" % numtime2)
......@@ -45,9 +44,9 @@ def auto_urge2():
urge_num = random.randint(0, 1)
if urge_num == 1:
id = int(j[0])
# time.sleep(random.randint(10, 50))
cookies = login()
if cookies is not None:
Urge(cookies, id)
except:
logging_exception()
logging.error("catch exception,main:%s" % traceback.format_exc())
......@@ -6,6 +6,7 @@ import logging
import datetime
from vest.request.auto_request import get_offline_comment
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
auto_reply_url = "http://saturn.iyanzhi.com/api/v1/reply/create_for_inner"
......@@ -76,4 +77,5 @@ if __name__ == "__main__":
comment = comment_list[i]
reply(id[0], comment, user_id)
except:
logging_exception()
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