Commit f45740c1 authored by lixiaofang's avatar lixiaofang

add

parents 4b38c9b5 f78b00d7
...@@ -25,26 +25,26 @@ auto_reply_url = "http://earth.gmapp.env/api/v1/reply/create" ...@@ -25,26 +25,26 @@ auto_reply_url = "http://earth.gmapp.env/api/v1/reply/create"
auto_follow_url = "http://earth.gmapp.env/api/v1/follow" auto_follow_url = "http://earth.gmapp.env/api/v1/follow"
auto_urge_url = "http://earth.gmapp.env/api/v1/user/urge" auto_urge_url = "http://earth.gmapp.env/api/v1/user/urge"
# DATABASES = { DATABASES = {
# 'default': { 'default': {
# 'ENGINE': 'django.db.backends.mysql', 'ENGINE': 'django.db.backends.mysql',
# 'NAME': 'alpha', 'NAME': 'alpha',
# 'USER': 'work', 'USER': 'work',
# 'PASSWORD': 'Gengmei123!', 'PASSWORD': 'Gengmei123!',
# 'HOST': 'bj-cdb-55ejhsjy.sql.tencentcdb.com', 'HOST': 'bj-cdb-55ejhsjy.sql.tencentcdb.com',
# 'PORT': '62177', 'PORT': '62177',
# 'OPTIONS': { 'OPTIONS': {
# "init_command": "SET foreign_key_checks = 0;", "init_command": "SET foreign_key_checks = 0;",
# "charset": "utf8mb4", "charset": "utf8mb4",
# }, },
# } }
# } }
# auto_click_url = "http://earth.iyanzhi.com/api/v1/like" # auto_click_url = "http://earth.iyanzhi.com/api/v1/like"
# auto_reply_url = "http://earth.iyanzhi.com/api/v1/reply/create" # auto_reply_url = "http://earth.iyanzhi.com/api/v1/reply/create"
# auto_follow_url = "http://earth.iyanzhi.com/api/v1/follow" # auto_follow_url = "http://earth.iyanzhi.com/api/v1/follow"
# auto_urge_url = "http://earth.iyanzhi.com/api/v1/user/urge" # auto_urge_url = "http://earth.iyanzhi.com/api/v1/user/urge"
#
# DATABASES = { # DATABASES = {
# 'default': { # 'default': {
# 'ENGINE': 'django.db.backends.mysql', # 'ENGINE': 'django.db.backends.mysql',
...@@ -132,7 +132,6 @@ def login(): ...@@ -132,7 +132,6 @@ def login():
def logins(user_id): def logins(user_id):
try: try:
cookies = get_cookies(user_id) cookies = get_cookies(user_id)
# cookies = "yhlcnc7q3louskthgpjguoi5n7r326cm"
if cookies is not None: if cookies is not None:
return {'sessionid': cookies} return {'sessionid': cookies}
......
import pymysql import pymysql
import traceback import traceback
import logging import logging
import json
from vest.request.auto_request import host, user, db, passwd from vest.request.auto_request import host, user, db, passwd
from libs.cache import redis_client from libs.cache import redis_client
from libs.error import logging_exception from libs.error import logging_exception
...@@ -38,7 +39,7 @@ def auto_user_id(): ...@@ -38,7 +39,7 @@ def auto_user_id():
for i in data: for i in data:
file.write(str(i[0])) file.write(str(i[0]))
file.write("\n") file.write("\n")
redis_client.set("get_user_id_data", data) redis_client.set("get_user_id_data", json.dumps(data))
except: except:
logging_exception() logging_exception()
......
...@@ -3,7 +3,9 @@ import pymysql ...@@ -3,7 +3,9 @@ import pymysql
import random import random
import traceback import traceback
import logging import logging
import json
import datetime import datetime
from libs.cache import redis_client
from vest.request.auto_request import get_offline_comment from vest.request.auto_request import get_offline_comment
from vest.request.auto_request import host, user, db, passwd from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception from libs.error import logging_exception
...@@ -61,14 +63,22 @@ def vest_click_reply(): ...@@ -61,14 +63,22 @@ def vest_click_reply():
logging.info("get majia data11111111111") logging.info("get majia data11111111111")
now = datetime.datetime.now() now = datetime.datetime.now()
yes_time = now - datetime.timedelta(minutes=5) yes_time = now - datetime.timedelta(minutes=5)
user_data = open("/srv/apps/physical/vest/data/get_user_id.txt", "r")
data = json.loads(redis_client.get("get_user_id_data"))
logging.info("get data-----------vest:%s" % data)
# user_data = open("/srv/apps/physical/vest/data/get_user_id.txt", "r")
user_list = [] user_list = []
for i in user_data.readlines(): for i in data.readlines():
user_list.append(i) user_list.append(i)
logging.info("get user_list-----------vest:%s" % user_list)
topic_id = get_data(yes_time, now) topic_id = get_data(yes_time, now)
if topic_id: if topic_id:
for id in topic_id: for id in topic_id:
rand_num = random.randint(1, 3) rand_num = random.randint(0, 4)
for i in range(rand_num): for i in range(rand_num):
num = random.randint(0, len(user_list) - 1) num = random.randint(0, len(user_list) - 1)
user_id = user_list[num] user_id = user_list[num]
......
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