Commit 77aba473 authored by lixiaofang's avatar lixiaofang

add

parent f31fbaeb
import time
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, click, time_conv
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()
logging.info("get numtime:%s" % numtime)
logging.info("get numtime2:%s" % numtime2)
cursor.execute(
"SELECT user_id,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 = []
logging.info("get topic_id:%s" % topic_id)
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
pass
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
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.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_conv
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()
logging.info("get numtime:%s" % numtime)
logging.info("get numtime2:%s" % numtime2)
cursor.execute(
"SELECT user_id,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 = []
logging.info("get topic_id:%s" % topic_id)
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
pass
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
logging.info("click four")
numtime, numtime2 = time_conv(47,37)
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:
click(cook, i[1])
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
\ No newline at end of file
import time
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, click, time_conv
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()
logging.info("get numtime:%s" % numtime)
logging.info("get numtime2:%s" % numtime2)
cursor.execute(
"SELECT user_id,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 = []
logging.info("get topic_id:%s" % topic_id)
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
pass
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
numtime, numtime2 = time_conv(5,0)
user_id = get_data(numtime, numtime2)
dicts = {}
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())
\ No newline at end of file
import time
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, click, time_conv
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()
logging.info("get numtime:%s" % numtime)
logging.info("get numtime2:%s" % numtime2)
cursor.execute(
"SELECT user_id,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 = []
logging.info("get topic_id:%s" % topic_id)
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
pass
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
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:
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_conv
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()
logging.info("get numtime:%s" % numtime)
logging.info("get numtime2:%s" % numtime2)
cursor.execute(
"SELECT user_id,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 = []
logging.info("get topic_id:%s" % topic_id)
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
pass
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
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:
cook = login()
if cook is not None:
click(cook, i[1])
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
想有同款
同求
超羡慕
时尚时尚最时尚
不盘不行
买买买!
我有,等等发给你
写的真的好棒呢
小手已经动起来了
想学都学不会
心情好才是真的好
我也是~
小心楼主飘起来了
买买买!
希望博主越来越好
我也关注啦
楼主,写了好几篇有用的内容呢
装进购物车吧
对大家都有帮助
还想看到更多,嘻嘻
心动不如行动
安排上了
必须整一个
我也超爱这个色系
可爱的要命
我也是
实不相瞒,我也是
没事,它还会回来的
我觉得看看就够了
看的有些心塞
你值得拥有
总能看到你
送你上去
WINK~ 
优秀
怎么啦?
一起冲
做梦都想变成这样的人
稳住
冲鸭!
比纯净水还纯
那你现在应该就挺满意的吧哈哈
换成小姐姐么哈哈哈
就这么简单吗
我们都会在的
也是我喜欢的
土掉渣的情话么?
捞你上去
我要给小姐姐大心心哈哈
那你想让小姐姐说啥
不许叫我的小姐姐宝贝
确实好看
我见过你!!
真是花式夸奖
根本不用忍
棒棒的
赞同
爱的不行
自恋的感觉吗
真的挺好看的
我也这么觉得
一直好看好不好
必须的
你自己数数
选我选我选我
词穷了都
还有我还有我!!
真会玩
差的可能是颜值
想学哈哈哈
不,钻石粉
我也喜欢
日常夸赞是么哈哈
就这个feel
送你上去
额滴个亲娘啊,这也太可爱了吧!同问这是哪个小仙女
哪个最喜欢
但是就是很喜欢是不是哈哈
酷!
滴!沙瓦迪卡
我也期待
我说好有用么
这么直接的吗
很喜欢小姐姐的内容
没道理的赞同你
支持支持
我们和小姐姐差的就是颜值
这条街最靓的
期待你的第二次
哈哈哈哈,催更+1
小姐姐要多发发帖子呀
小姐姐的帖子都超棒
认认真真的听着
也是我的小可爱
我也学习了
实不相瞒,我也喜欢
很有品位哦 要继续喜欢我的小姐姐
美坏了应该
喜欢这一类的分享
楼上就是彩虹屁本屁了
啧啧啧,甜度满分
我也想遇到小姐姐
我也可!!!
一直在+1
我不管,我也想了
毕竟是我爱的宝藏女孩
想想就行╭(╯^╰)╮
放进榜单!
来晚了,想插队
下次你一定会前排的
时光老了也不散
比心队形!
你是住在like吗,这都被你等到了!
是谁,跟我一样发现小可爱更新了!
才没有,她是大家的宝藏
看吼吼,plmm太棒了!
翻我!翻我!
淡定淡定,小姐姐的日常操作
同意
唉呀妈呀,贼稀罕
我也好喜欢这一类的诶
终于等到更新啦
同等ing
一起向前冲鸭
棒当然是天生的
什么小东西,人家是小可爱
醒醒,你刷到了,别怀疑自己
冯巩附体?
哪哪都有你,到处跟plmm恋爱!
比一点点还多一点点!
me too
木有感情的第一名
看见你我也很开心
双击666嘛
记好这是第几次迟到了
永远不会晚
前面的姐妹一起哭
我永远喜欢她.jpg
哈哈,我Gucci的时候,眼泪也Prada的掉
她肯定没忘记我萌♪(^∇^*)
首先,你得跟我一样优秀
辛亏没放弃
小姐姐文笔还是蛮好的
小粉丝+1
这不是来了嘛
来来来,给你让开了
小姐姐经常又在发呀
土味肉麻
你好夸张啊
我就看看不说话
咋分享
还能更直白么
你还可以更疯狂
酷!
真的假的
小姐姐经常发帖的呀
惊到了嘛?
小姐姐就是神仙本仙哈哈
下班快乐
me2
OMG 这是在公开告白么
666。。。
意外的点在于…?
小姐姐估计没戏,我勉强回复你一下吧
小桃心好可爱
土味情话?
一起做更好的自己
想我想到黑夜白天?
那我给你当前排
这是在找存在感么
凑热闹
这就有人告白了?
你还能更快么
同喜欢
➕1
试完了等你的帖子
来来来,我来回复你
你可以给小姐姐一个小红心
给小姐姐笔芯
想一同承包哈哈
棒呆
早早早
没有最棒,只有更棒
奖励你一个赞
充实每一天
我就看看小姐姐会不会给你翻牌
你真会说话
咦,小姐姐才不是你的宝贝
你也太会夸人了
小姐姐还有别的帖子也不错
借着你的楼上去哈哈
这个小姐姐之前的文章也超棒
我也很喜欢
你不想被赞到明年吗
肯定啊
等着你的分享
这个可以收藏么
小姐姐一般不回复
这个有难度么?
咋保存?
可以确定了,确实有这么好看的
你想得美
围观+1
占坑+1
借楼留名
挤挤
瓜子汽水小板凳要哇
带我一个
我也是
但是还是点进来了哈哈
是的!
我也在问我自己这个问题
贵么
有钱有钱
这么速度
这个能找到嘛?
拿起我的小本本
喜欢
棒棒哒
哈哈哈哈,真有意思
我觉得也适合我
羡慕,我也想找个适合我的
真好
哈哈哈哈哈哈希望是真的
好帖,保存了
一个够嘛
重要的话说三遍是么哈哈
不要抢我的小姐姐
是哦
必须的必
我也来打call
用给你递个电话么
带上我
为小姐姐心动过很多次了
心动ing
怎么试?教教我
蛮有用的
同码
我也很喜欢呢
同码!
找到告诉我
一起学习,天天向上
cool~
我也是呢
我也是哈哈哈
谁不是呢
我希望有花不完的钱
哈哈哈我也是
同被吸引到了
同被诱惑到了
get+1
怎么加?
完美!
是呢
我同意
好看哦
酷的一匹
超绝
你好,我是小姐姐后援会会长哈哈
我也是!
我也没想到
小姐姐的帖子都挺不错的
蛮实用的
下回我也试试
感谢帖主呢
我也可以!
我不信~
是的都好好看
太逆生长了叭
我也觉得是呢
我也喜欢
看到志同道合的胖友了
可惜学不会~
那当然了
真的是被小姐姐的点戳中了
喜欢的嘞
找到了另一个小迷妹
哈哈,我也是
都很有用呢
不要抢我的小姐姐
带上我
喜欢这种风格
可以+1
喜欢
爱了爱了
说的是呢
这个小姐姐很厉害的
真的好
差的不是角度是颜值
很实用呢
小粉丝路过
➕1
棒呆
真是种不完的草
这个好可爱
笔芯
加上我
相当可以
大心心哈哈哈哈
biubiubiu
加个我的
带上我
get了
赶紧拉起粉丝群哈哈
同问
同求
哈哈哈 你这是一条语音评论么
有链接嘛?
说的是呢
我也是
get了
码住
你不是一个人,小姐姐分享的我也很喜欢呢
学起来
哈哈我也是
我也是
喜欢呢
喜欢
是的了
真的是!
写的好棒
加个“!”
真的秀
还是小姐姐写的好吧
秀出新高度
get.
超爱
赞同
哈哈我也是
码住
腻害
真的厉害
同想试试
我也这么想
真可以试试
米兔
我这次就要试一试
我好喜欢
最喜欢干货了
嗯嗯 我也是
是的是的!
哈哈哈是无敌了
是的是的!
好玩
我也是超喜欢
夸爆
炒鸡棒
心动到不行
安排上了
棒棒棒
666
感谢帖主
是的!我都不知道在这里吃了多少安利了
没能逃过被种草
辛苦帖主
喜欢呢
我也是
谢谢帖主
感谢帖主
也适合我,谢谢帖主
是的哦 感谢楼主
是的喂
哈哈哈一样一样
可以可以相当可以
超棒的帖子
棒棒的帖子
也是我喜欢的
我也喜欢这个帖子哈哈
我也爱了
哈哈哈哈哈我也是
已经打开了某宝
干货
我也超爱
赞赞赞
666
我也终于看到适合我的了
wow!
没错,是她是她就是她
谁不是呢
哈哈哈哈哈哈我也是
吃土少女的自虐哈哈哈哈哈
我也是 好喜欢啊
我也是!终于!
必须的!
感觉蛮有用的
你闺蜜:我不吃。哈哈哈哈哈
呼呼,我已经是第二次被种草了
激动!我也是
我也要安利给我朋友
哈哈哈哈哈好巧,我也在安利
我也是!激动
我也爱!
我也在问自己这个问题
我也是呢!超级喜欢
因为要花钱了哈哈
我也超级喜欢
➕1
我也是我也是
我也是!真不容易
哈哈哈我也是!
我也炒鸡喜欢 get!
也戳中我了
wow
要去安利我的姐妹
立刻去分享给姐妹
同求
这个滤镜真好看
小姐姐太棒了
➕1我也想要
仙女➕1
谁不想要呢
瓜子准备啦
同意
我缺的是摄影师吗。我缺的是颜值
也太棒了吧
我也想收藏!
是啊,我也这种感觉
是的呢,我最喜欢的博主
点赞
我最喜欢第二张
喜欢
我先!
好像专业摄影师拍的诶
姐妹,我也能拍
码住哦
okok
d=====( ̄▽ ̄*)b厉害
我也想要连接
我要多学习
小姐姐是我的!
同期待
hhhh
长得美就行
想换头
前排瓜子准备好了
美就一个字
那我就不一样了。我特别喜欢
搓手期待
biubiubiu
举手报名,我也想和小姐姐当朋友
前排先赞一个
这个滤镜可真好看
天气可真好啊
你是调查户口的吗
2333333
我喜欢图2
我家小姐姐最棒
我也是我也是
想知道怎么拍的
我也觉得,一定是男朋友拍的
这是哪里呀
我是你的粉头
火前留名
赞一个赞一个
同感同感
吃下这枚安利喽
赞一个
感觉是专业的相机诶
我先来承包
哼。我先来的
我喜欢封面!
嘿嘿,是可爱的小姐姐没错了
你也可以的
前排留名
小声bb)我也想
我也是!不许跟我抢
嗷嗷嗷我也觉得
同求
我也喜欢!
你走开,小姐姐是我的
爱辽
我也想用。。。
是我的小姐姐
嗷嗷,你不喜欢我了吗
太可爱喽,我喜欢的颜值类型
我也想横着走!
好甜啊
你怎么也这么可爱啊
点头同意
美丽
哼。我先来的
拍照新姿势!
我最喜欢封面
手残党,学不会
哇塞小姐姐好好看,爱了爱了
求教程
➕11111
求连接呀
直接被种草了
感觉很有用
好可爱
同感
种草了哦
咱俩这么多同款吗
可以看看我家的产品哦
行走的种草机
是的呢
新技能get!
This diff is collapsed.
This diff is collapsed.
import requests
import time
import datetime
import pymysql
import random
import traceback
import logging
from log_settings import *
from auto_request import login, time_convs, reply, get_comment, click
from auto_request import host, user, db, passwd
def get_topic_id(numtime1, numtime2):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT id,user_id FROM topic WHERE is_online=1 and create_time > '%s' and create_time < '%s' and id not in "
"(select topic_id from reply where create_time > '%s' and create_time < '%s')" % (
numtime1, numtime2, numtime1, numtime2)
)
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 []
if __name__ == "__main__":
try:
numtime1, numtime2 = time_convs(8, 0)
user_id = get_topic_id(numtime1, numtime2)
for i in user_id:
cook = login()
if cook is not None:
click(cook, i[0])
comment = get_comment()
reply(cook, i[0], comment)
except:
logging.error("catch exception,main :%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_convs, follow
from auto_request import host, user, port, db, passwd
def get_data(numtime1, 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'" % (
numtime1, numtime2))
data = cursor.fetchall()
user_id = list(data)
topic_id_list = []
if user_id:
for i in user_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
id = list(data)
if id:
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())
return []
if __name__ == "__main__":
try:
time_list = [1, 2, 3, 4, 5, 6, 7]
numtime1, numtime2 = time_convs(8, 0)
user_id = get_data(numtime1, numtime2)
for j in user_id and user_id:
id = int(j[0])
cookies = login()
if cookies is not None:
follow(cookies, id)
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_convs, follow
from auto_request import host, user, port, db, passwd
def get_commnet_id(numtime):
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT user_id FROM reply WHERE create_time > '%s' " % numtime)
data_comment = cursor.fetchall()
cursor.execute(
"SELECT t.user_id from topic t left join reply r on r.topic_id = t.id WHERE r.create_time > '%s'" % numtime)
data_reply_topic = cursor.fetchall()
cursor.execute(
"SELECT r.user_id from reply r left join reply p on r.replied_id = p.replied_id WHERE p.create_time > '%s'" % numtime)
data_reply_reply = cursor.fetchall()
cursor.execute(
"SELECT user_id FROM group_user_role WHERE create_time > '%s' " % numtime)
data_group_follow = cursor.fetchall()
cursor.execute(
"select user_id from account_user WHERE create_time > '%s'" % numtime)
data_new_user = cursor.fetchall()
data_id = list(data_comment)
data1_id = list(data_reply_topic)
data2_id = list(data_group_follow)
data3_id = list(data_new_user)
data_reply = list(data_reply_reply)
topic_id_list = []
for i in data_id and data_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data1_id and data1_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data2_id and data2_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data3_id and data3_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
for i in data_reply and data_reply:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
return topic_id_list
if __name__ == "__main__":
try:
numtime1, numtime2 = time_convs(1, 2)
user_id = get_commnet_id(numtime1)
try:
for j in user_id and user_id:
id = int(j[0])
follow_num = random.randint(0, 1)
for i in range(follow_num):
time.sleep(random.randint(10, 50))
cookies = login()
if cookies is not None:
follow(cookies, id)
except:
pass
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_conv, get_comment, reply
from auto_request import host, user, db, passwd
def get_data(numtime, numtime2):
try:
print("....")
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 is_online=1 and (create_time > '%s' and create_time < '%s' )" % (
numtime, numtime2))
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
print(user_id)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
logging.info("comment one")
numtime1, numtime2 = time_conv(5, 0)
user_id = get_data(numtime1, numtime2)
dicts = {}
if user_id:
for i in user_id:
cook = login()
comment = get_comment()
if cook is not None:
reply(cook, i[1], comment)
else:
logging.error("catch exception,main:%s" % traceback.format_exc())
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, time_conv, get_comment, reply
from auto_request import host, user, db, passwd
def get_data(numtime, numtime2):
try:
print("....")
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 is_online=1 and (create_time > '%s' and create_time < '%s' )" % (
numtime, numtime2))
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
print(user_id)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
logging.info(" commend three")
numtime1, numtime2 = time_conv(45, 35)
user_id = get_data(numtime1, numtime2)
dicts = {}
if user_id:
for i in user_id:
rand_num = random.randint(0, 1)
if rand_num == 1:
cook = login()
comment = get_comment()
if cook is not None:
reply(cook, i[1], comment)
else:
logging.error("catch exception,main:%s" % traceback.format_exc())
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, time_conv, get_comment, reply
from auto_request import host, user, db, passwd
def get_data(numtime, numtime2):
try:
print("....")
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 is_online=1 and (create_time > '%s' and create_time < '%s' )" % (
numtime, numtime2))
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
print(user_id)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
logging.info("comment two")
numtime1, numtime2 = time_conv(27, 17)
user_id = get_data(numtime1, numtime2)
dicts = {}
if user_id:
for i in user_id:
rand_num = random.randint(0, 1)
if rand_num == 1:
cook = login()
comment = get_comment()
if cook is not None:
reply(cook, i[1], comment)
else:
logging.error("catch exception,main:%s" % traceback.format_exc())
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import pymysql
import traceback
import logging
import datetime
import json
from log_settings import *
from auto_request import login, time_conv_minute, get_answer_data, reply_answer, set_reply_to_redis, reply2, logins, \
get_majia, get_majia_reply
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 user_id,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 = []
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
logging.info("comment answer one")
numtime1, numtime2, minute = time_conv_minute(5, 0)
user_id = get_data(numtime1, numtime2)
redis_key1 = "cybertron:set_reply_id:one"
reply_data_comment = []
if user_id:
for i in user_id:
majia_user_id = get_majia()
logging.info("get majia_user-id:%s" % majia_user_id)
cook = logins(majia_user_id)
comment1, comment2 = get_answer_data()
logging.info("get comment1:%s" % comment1)
logging.info("get comment2:%s" % comment2)
if cook is not None:
response = reply_answer(cook, i[1], comment1)
if len(response) > 1:
data_dict = json.loads(response)
reply_id = data_dict["data"]["id"]
reply_user_id = data_dict["data"]["user"]["id"]
topic_id = i[1]
reply_data_comment.append(
{"id": reply_id, "reply_user_id": reply_user_id, "answer": comment2, "topic_id": topic_id,
"majia_user_id": majia_user_id})
redis_client = set_reply_to_redis()
redis_client.hset(redis_key1, str(minute), json.dumps(reply_data_comment))
logging.info("get eeeeeeee:%s" % str(minute - 5))
have_reply1 = redis_client.hget(redis_key1, str(minute - 5))
logging.info("get have_reply1:%s" % have_reply1)
if have_reply1:
result = json.loads(str(have_reply1, encoding="utf-8"))
redis_client.hdel(redis_key1, str(minute - 5))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import pymysql
import traceback
import logging
import json
from log_settings import *
from auto_request import logins, reply, get_comment, time_conv, get_answer_data, reply_answer, get_majia, \
set_reply_to_redis
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 user_id,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 = []
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
print(user_id)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
logging.info("comment answer one")
numtime1, numtime2 = time_conv(27, 17)
user_id = get_data(numtime1, numtime2)
redis_key = "cybertron:set_reply_id:two"
reply_data_comment = []
if user_id:
for i in user_id:
majia_user_id = get_majia()
cook = logins(majia_user_id)
comment1, comment2 = get_answer_data()
if cook is not None:
response = reply_answer(cook, i[1], comment1)
if len(response) > 1:
data_dict = json.loads(response)
reply_id = data_dict["data"]["id"]
reply_user_id = data_dict["data"]["user"]["id"]
reply_data_comment.append(
{"id": reply_id, "reply_user_id": reply_user_id, "answer": comment2, "topic_id": i[1],
"majia_user_id": majia_user_id})
redis_client = set_reply_to_redis()
redis_client.set(redis_key, json.dumps(reply_data_comment))
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import pymysql
import traceback
import logging
import json
from log_settings import *
from auto_request import logins, reply, get_comment, time_conv, get_answer_data, reply_answer, set_reply_to_redis, \
get_majia
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 user_id,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 = []
try:
for i in topic_id and topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0")
data = cursor.fetchall()
user_id = list(data)
print(user_id)
if user_id:
topic_id_list.append(i)
logging.info("Database version : %s " % topic_id_list)
pc.close()
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return []
if __name__ == "__main__":
try:
logging.info("comment answer one")
numtime1, numtime2 = time_conv(45, 35)
user_id = get_data(numtime1, numtime2)
redis_key1 = "cybertron:set_reply_id:three"
reply_data_comment = []
if user_id:
for i in user_id:
majia_user_id = get_majia()
cook = logins(majia_user_id)
comment1, comment2 = get_answer_data()
if cook is not None:
response = reply_answer(cook, i[1], comment1)
if len(response) > 1:
data_dict = json.loads(response)
reply_id = data_dict["data"]["id"]
reply_user_id = data_dict["data"]["user"]["id"]
reply_data_comment.append(
{"id": reply_id, "reply_user_id": reply_user_id, "answer": comment2, "topic_id": i[1],
"majia_user_id": majia_user_id})
redis_client = set_reply_to_redis()
redis_client.set(redis_key1, json.dumps(reply_data_comment))
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import traceback
import redis
import logging
import json
from log_settings import *
from auto_request import set_reply_to_redis, reply2, logins, get_majia_reply
if __name__ == "__main__":
try:
redis_key1 = "cybertron:set_reply_id:two"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import traceback
import redis
import logging
import json
from log_settings import *
from auto_request import set_reply_to_redis, reply2, logins,get_majia_reply
if __name__ == "__main__":
try:
redis_key1 = "cybertron:set_reply_id:three"
redis_client = set_reply_to_redis()
have_reply1 = redis_client.get(redis_key1)
result = json.loads(str(have_reply1, encoding="utf-8"))
if result:
for item in result:
majia_user_id = get_majia_reply(item["majia_user_id"])
cook = logins(majia_user_id)
reply2(cook, item["topic_id"], item["answer"], item["id"])
redis_client.delete(redis_key1)
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
This diff is collapsed.
import pymysql
import traceback
import logging
from auto_request import host, user, db, passwd
from log_settings import *
def get_data():
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute("select user_id from user_extra where is_shadow = 1 ")
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % user_id)
user_id_list = []
if user_id:
for i in user_id:
cursor.execute("select user_id from topic where user_id = " + str(
i[0]) + " group by user_id having count(user_id) >5")
data = cursor.fetchall()
user_id = list(data)
if len(user_id):
print(user_id)
user_id_list.append(user_id[0])
else:
pass
pc.close()
return user_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return None
data = get_data()
print(data)
file = open("/data/log/cybertron/app/user_id.txt", "w")
if data:
for i in data:
file.write(str(i[0]))
file.write("\n")
import requests
import traceback
import logging
login_url = "http://earth.gmapp.env/api/account/login_pwd"
def index_first():
try:
r1 = requests.get(login_url)
return r1.cookies.get_dict()
except:
logging.error("index_first:%s" % traceback.format_exc())
return None
def get_cook():
data = open("batch_user_gen")
list = []
dicts = {}
for i in data:
list.append(i.strip('\n').strip(','))
for i in list:
cookies = index_first()
post_dict = {
'account_type': 2,
'pwd': '123456',
'email': i
}
response = requests.post(
url=login_url,
data=post_dict,
cookies=cookies
)
headers = response.headers
print(response.text)
cook = headers['Set-Cookie'].split(";")
cook = cook[0].split('=')[1]
logging.info("response.text :%s" % response.text)
dicts[i] = cook
return dicts
dicts = get_cook()
with open("/data/log/cybertron/app/user_session.txt", 'w') as f:
for key, value in dicts.items():
f.write(key)
f.write(",")
f.write(value)
f.write("\n")
import requests
import time
import datetime
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_convs, follow, Urge
from auto_request import host, user, db, passwd
def get_data(numtime):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db="physical", port=3306)
cursor = pc.cursor()
cursor.execute(
"select user_id from sl_user_login_status where last_visit_day < '%s' and is_shadow =0 " % numtime)
data = cursor.fetchall()
user_id = list(data)
logging.info("Database version : %s " % user_id)
# topic_id_list = []
# for i in user_id and user_id:
# pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
# cursor = pc.cursor()
# cursor.execute(
# "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
# data = cursor.fetchall()
# user_id = list(data)
# if user_id:
# topic_id_list.append(i)
# logging.info("Database version : %s " % topic_id_list)
pc.close()
return user_id
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return None
if __name__ == "__main__":
try:
numtime1, numtime2 = time_convs(1, 3)
user_id = get_data(numtime2)
for i in user_id:
id = int(i[0])
cook = login()
if cook is not None:
Urge(cook, id)
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_convs, follow, Urge
from auto_request import host, user, db, passwd
def get_data(numtime):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db="physical", port=3306)
cursor = pc.cursor()
cursor.execute(
"select user_id from sl_user_login_status where last_visit_day < '%s' and is_shadow = 0 " % numtime)
data = cursor.fetchall()
user_id = list(data)
# topic_id_list = []
# for i in user_id and user_id:
# pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
# cursor = pc.cursor()
# cursor.execute(
# "select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
# data = cursor.fetchall()
# user_id = list(data)
# if user_id:
# topic_id_list.append(i)
logging.info("Database version : %s " % user_id)
pc.close()
return user_id
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return None
if __name__ == "__main__":
try:
numtime1, numtime2 = time_convs(1, 3)
user_id = get_data(numtime2)
for i in user_id and user_id:
num = random.randint(0, 1)
if num == 1:
id = int(i[0])
cook = login()
if cook is not None:
Urge(cook, id)
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_convs, Urge
from auto_request import host, user, db, passwd
def get_star_useid(numtime1, 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) and create_time > '%s' and create_time < '%s'" % (
numtime1, numtime2))
data = cursor.fetchall()
user_id = list(data)
topic_id_list = []
for i in user_id and user_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
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())
return None
if __name__ == "__main__":
try:
numtime1, numtime2 = time_convs(8, 0)
user_id = get_star_useid(numtime1, numtime2)
for j in user_id and user_id:
id = int(j[0])
for i in range(1):
cookies = login()
if cookies is not None:
Urge(cookies, id)
except:
logging.error("catch exception,main:%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_convs, Urge
from auto_request import host, port, passwd, user, db
import threading
def get_data(numtime1, 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'" % (
numtime1, numtime2))
data = cursor.fetchall()
user_id = list(data)
topic_id_list = []
for i in user_id and user_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
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())
return None
if __name__ == "__main__":
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)
user_id = get_data(numtime1, numtime2)
urge_num = random.randint(0, 1)
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.error("catch exception,main:%s" % traceback.format_exc())
import requests
import time
import datetime
import pymysql
import random
import traceback
from log_settings import *
import logging
from auto_request import login, time_convs, Urge
from auto_request import host, port, passwd, user, db
import threading
def get_data(numtime1, 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'" % (
numtime1, numtime2))
data = cursor.fetchall()
user_id = list(data)
topic_id_list = []
for i in user_id and user_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(i[0]) + " and is_shadow =0 ")
data = cursor.fetchall()
user_id = list(data)
if user_id:
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())
return None
if __name__ == "__main__":
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)
user_id = get_data(numtime1, numtime2)
for j in user_id and user_id:
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.error("catch exception,main:%s" % traceback.format_exc())
import requests
import pymysql
import random
from log_settings import *
import traceback
import logging
import datetime
from auto_request import get_offline_comment
from auto_request import host, user, db, passwd
auto_reply_url = "http://saturn.iyanzhi.com/api/v1/reply/create_for_inner"
def reply(id, content, user_id):
try:
post_dict = {
'user_id': user_id,
'topic_id': id,
'content': content,
"type": 4
}
response = requests.post(url=auto_reply_url,
data=post_dict)
logging.info("response.text:%s" % response.text)
except:
logging.error("catch exception,logins:%s" % traceback.format_exc())
def get_data(now, noww):
try:
pc = pymysql.connect(host=host, user=user, passwd=passwd, db=db, port=3306)
cursor = pc.cursor()
cursor.execute(
"SELECT id,user_id FROM topic WHERE ( create_time > '%s' and create_time <= '%s' ) and is_online = 1 and content_level in (4,5,6) " % (
now, noww))
data = cursor.fetchall()
topic_id = list(data)
topic_id_list = []
for id in topic_id:
cursor.execute(
"select user_id from user_extra where user_id =" + str(id[1]) + " and is_shadow =1")
data = cursor.fetchall()
user_id = list(data)
if user_id:
topic_id_list.append(i)
pc.close()
logging.info("get topic_id_list:%s" % topic_id_list)
return topic_id_list
except:
logging.error("catch exception,get_data:%s" % traceback.format_exc())
return None
if __name__ == "__main__":
try:
now = datetime.datetime.now()
yes_time = now - datetime.timedelta(minutes=5)
user_data = open("/data/log/cybertron/app/user_id.txt", "r")
user_list = []
for i in user_data.readlines():
user_list.append(i)
topic_id = get_data(yes_time, now)
dicts = {}
if topic_id:
for id in topic_id:
rand_num = random.randint(1, 3)
for i in range(rand_num):
num = random.randint(0, len(user_list) - 1)
user_id = user_list[num]
if user_id != id[1]:
comment_list = get_offline_comment()
comment = comment_list[i]
reply(id[0], comment, user_id)
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