|
|
|
@ -0,0 +1,752 @@
|
|
|
|
|
# encoding=utf8
|
|
|
|
|
import requests
|
|
|
|
|
import time
|
|
|
|
|
import random
|
|
|
|
|
from fake_useragent import UserAgent
|
|
|
|
|
from lxml import etree
|
|
|
|
|
from qq import Reminder
|
|
|
|
|
from main import read_data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def write_error(error):
|
|
|
|
|
error = repr(error)
|
|
|
|
|
print(error)
|
|
|
|
|
with open('static/error.txt', 'a') as f:
|
|
|
|
|
error = error + str(time.asctime(time.localtime(time.time()))) + '\n'
|
|
|
|
|
f.write(error)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
title = ["华盛顿",
|
|
|
|
|
"柳宗元",
|
|
|
|
|
"歌德",
|
|
|
|
|
"荀况",
|
|
|
|
|
"莎士比亚",
|
|
|
|
|
"卡耐基",
|
|
|
|
|
"狄尔治夫人",
|
|
|
|
|
"周恩来",
|
|
|
|
|
"郭小川",
|
|
|
|
|
"惠特曼",
|
|
|
|
|
"保罗",
|
|
|
|
|
"列夫·托尔斯泰",
|
|
|
|
|
"裴多菲",
|
|
|
|
|
"萧伯纳",
|
|
|
|
|
"卡耐基",
|
|
|
|
|
"刘备",
|
|
|
|
|
"伊索",
|
|
|
|
|
"易卜生",
|
|
|
|
|
"卡耐基",
|
|
|
|
|
"居里夫人",
|
|
|
|
|
"雷锋",
|
|
|
|
|
"列夫·托尔斯泰",
|
|
|
|
|
"歌德",
|
|
|
|
|
"列夫·托尔斯泰",
|
|
|
|
|
"契诃夫",
|
|
|
|
|
"罗曼·罗兰",
|
|
|
|
|
"奥斯特洛夫斯基",
|
|
|
|
|
"爱因斯坦",
|
|
|
|
|
"贝多芬",
|
|
|
|
|
"诸葛亮",
|
|
|
|
|
"歌德",
|
|
|
|
|
"亚里士多德",
|
|
|
|
|
"保罗",
|
|
|
|
|
"高尔基",
|
|
|
|
|
"黎凯",
|
|
|
|
|
"布鲁诺",
|
|
|
|
|
"都德",
|
|
|
|
|
"培根",
|
|
|
|
|
"马克思",
|
|
|
|
|
"刘向",
|
|
|
|
|
"奥斯特洛夫斯基",
|
|
|
|
|
"荀况",
|
|
|
|
|
"梅茵",
|
|
|
|
|
"罗曼·罗兰",
|
|
|
|
|
"富兰克林",
|
|
|
|
|
"毕加索",
|
|
|
|
|
"宣永光",
|
|
|
|
|
"莎士比亚",
|
|
|
|
|
"蒙田",
|
|
|
|
|
"弗洛伊德",
|
|
|
|
|
"苏格拉底",
|
|
|
|
|
"陶铸",
|
|
|
|
|
"吉鸿昌",
|
|
|
|
|
"方志敏",
|
|
|
|
|
"毕达哥拉斯",
|
|
|
|
|
"屠格涅夫",
|
|
|
|
|
"萨迪",
|
|
|
|
|
"萧楚女",
|
|
|
|
|
"萨迪",
|
|
|
|
|
"罗丹",
|
|
|
|
|
"萧伯纳",
|
|
|
|
|
"莎士比亚",
|
|
|
|
|
"萧伯纳",
|
|
|
|
|
"西塞罗",
|
|
|
|
|
"高汀",
|
|
|
|
|
"但丁",
|
|
|
|
|
"德谟克里特",
|
|
|
|
|
"高尔基",
|
|
|
|
|
"罗丹",
|
|
|
|
|
"伊索",
|
|
|
|
|
"富兰克林",
|
|
|
|
|
"伊索",
|
|
|
|
|
"奥斯特洛夫斯基",
|
|
|
|
|
"张志新",
|
|
|
|
|
"夏明翰",
|
|
|
|
|
"方志敏",
|
|
|
|
|
"方志敏",
|
|
|
|
|
"鲁迅",
|
|
|
|
|
"伏尔泰",
|
|
|
|
|
"歌德",
|
|
|
|
|
"杰弗逊",
|
|
|
|
|
"艾普利亚",
|
|
|
|
|
"歌德",
|
|
|
|
|
"拿破仑",
|
|
|
|
|
"孔丘",
|
|
|
|
|
"鲁迅",
|
|
|
|
|
"卡耐基",
|
|
|
|
|
"居里夫人",
|
|
|
|
|
"伏契克",
|
|
|
|
|
"斯特林堡",
|
|
|
|
|
"罗曼·罗兰",
|
|
|
|
|
"郑板桥",
|
|
|
|
|
"鲁迅",
|
|
|
|
|
"契诃夫",
|
|
|
|
|
"恩格斯",
|
|
|
|
|
"鲁迅",
|
|
|
|
|
"雨果",
|
|
|
|
|
"车尔尼雪夫斯基",
|
|
|
|
|
"车尔尼雪夫斯基",
|
|
|
|
|
"卢森堡",
|
|
|
|
|
"艾普利亚",
|
|
|
|
|
"车尔尼雪夫斯基",
|
|
|
|
|
"车尔尼雪夫斯基",
|
|
|
|
|
"吴运铎",
|
|
|
|
|
"培根",
|
|
|
|
|
"卡耐基",
|
|
|
|
|
"鲁迅",
|
|
|
|
|
"列宁",
|
|
|
|
|
"高尔基",
|
|
|
|
|
"居里夫人",
|
|
|
|
|
"列宁",
|
|
|
|
|
"涅克拉索夫",
|
|
|
|
|
"列宁",
|
|
|
|
|
"列宁",
|
|
|
|
|
"贝弗里奇",
|
|
|
|
|
"爱因斯坦",
|
|
|
|
|
"大仲马",
|
|
|
|
|
"谢觉哉",
|
|
|
|
|
"萨迪", ]
|
|
|
|
|
words = ["自己不能胜任的事情,切莫轻易答应别人,一旦答应了别人,就必须实践自己的诺言。--华盛顿",
|
|
|
|
|
"君子在下位则多谤,在上位则多誉;小人在下位则多誉,在上位则多谤。--柳宗元",
|
|
|
|
|
"你若要喜爱你自己的价值,你就得给世界创造价值。--歌德",
|
|
|
|
|
"君子赠人以言,庶人赠人以财。--荀况",
|
|
|
|
|
"时间会刺破青春表面的彩饰,会在美人的额上掘深沟浅槽;会吃掉稀世之珍!天生丽质,什么都逃不过他那横扫的镰刀。--莎士比亚",
|
|
|
|
|
"如果我们想交朋友,就要先为别人做些事——那些需要花时间、体力、体贴、奉献才能做到的事。--卡耐基",
|
|
|
|
|
"原谅敌人要比原谅朋友容易。--狄尔治夫人",
|
|
|
|
|
"我们爱我们的民族,这是我们自信心的源泉。--周恩来",
|
|
|
|
|
"愿每次回忆,对生活都不感到负疚。--郭小川",
|
|
|
|
|
"对人不尊敬,首先就是对自己的不尊敬。--惠特曼",
|
|
|
|
|
"一个人的真正伟大之处就在于他能够认识到自己的渺小。--保罗",
|
|
|
|
|
"心灵纯洁的人,生活充满甜蜜和喜悦。--列夫·托尔斯泰",
|
|
|
|
|
"这灵魂;假如我不爱你,我的祖国,我能爱哪一个人?--裴多菲",
|
|
|
|
|
"自我控制是最强者的本能。--萧伯纳",
|
|
|
|
|
"对别人的意见要表示尊重。千万别说:"你错了。"--卡耐基",
|
|
|
|
|
"勿以恶小而为之,勿以善小而不为。惟贤惟德,能服于人。--刘备",
|
|
|
|
|
"那些背叛同伴的人,常常不知不觉地把自己也一起毁灭了。--伊索",
|
|
|
|
|
"社会犹如一条船,每个人都要有掌舵的准备。--易卜生",
|
|
|
|
|
"要使别人喜欢你,首先你得改变对人的态度,把精神放得轻松一点,表情自然,笑容可掬,这样别人就会对你产生喜爱的感觉了。--卡耐基",
|
|
|
|
|
"我们应该不虚度一生,应该能够说:"我已经做了我能做的事。"--居里夫人",
|
|
|
|
|
"我们是国家的主人,应该处处为国家着想。--雷锋",
|
|
|
|
|
"人生的价值,并不是用时间,而是用深度量去衡量的。--列夫·托尔斯泰",
|
|
|
|
|
"我们为祖国服务,也不能都采用同一方式,每个人应该按照资禀,各尽所能。--歌德",
|
|
|
|
|
"人生不是一种享乐,而是一桩十分沉重的工作。--列夫·托尔斯泰",
|
|
|
|
|
"求人帮助的时候,求穷人比求富人容易。--契诃夫",
|
|
|
|
|
"先相信自己,然后别人才会相信你。--罗曼·罗兰",
|
|
|
|
|
"人的一生可能燃烧也可能腐朽,我不能腐朽,我愿意燃烧起来!--奥斯特洛夫斯基",
|
|
|
|
|
"人只能有献身社会,才能找出那实际上是短暂而有风险的生命的意义。--爱因斯坦",
|
|
|
|
|
"成名的艺术家反为盛名所拘束,所以他们最早的作品往往是最好的。--贝多芬",
|
|
|
|
|
"夫君子之行,静以修身,俭以养德,非淡泊无以明志,非宁静无以致远。--诸葛亮",
|
|
|
|
|
"谁要游戏人生,他就一事无成,谁不能主宰自己,永远是一个奴隶。--歌德",
|
|
|
|
|
"人生最终的价值在于觉醒和思考的能力,而不只在于生存。--亚里士多德",
|
|
|
|
|
"人生犹如一本书,愚蠢者草草翻过,聪明人细细阅读。为何如此。因为他们只能读它一次。--保罗",
|
|
|
|
|
"我一向憎恶为自己的温饱打算的人。人是高于温饱的。--高尔基",
|
|
|
|
|
"人生是没有毕业的学校。--黎凯",
|
|
|
|
|
"为真理而斗争是人生最大的乐趣。--布鲁诺",
|
|
|
|
|
"好脾气是一个人在社交中所能穿着的最佳服饰。--都德",
|
|
|
|
|
"无论你怎样地表示愤怒,都不要做出任何无法挽回的事来。--培根",
|
|
|
|
|
"我们现在必须完全保持党的纪律,否则一切都会陷入污泥中。--马克思",
|
|
|
|
|
"少而好学,如日出之阳;壮而好学,如日中之光;老而好学,如炳烛之明。--刘向",
|
|
|
|
|
"我们唯一不会改正的缺点是软弱。--奥斯特洛夫斯基",
|
|
|
|
|
"骐骥一跃,不能十步;驽马十驾,功在不舍;锲而舍之,朽木不折;锲而不舍,金石可镂。--荀况",
|
|
|
|
|
"习惯是一条巨缆——我们每天编结其中一根线,到最后我们最终无法弄断它。--梅茵",
|
|
|
|
|
"人生是一场赌博。不管人生的财博是得是损,只要该赌的肉尚剩一磅,我就会赌它。--罗曼·罗兰",
|
|
|
|
|
"不惜牺牲自由以图苟安的人,既不配享受自由,也不配获得安全。--富兰克林",
|
|
|
|
|
"呵!高尚的风度!多可怕的东西!风度乃是创造力的敌人。--毕加索",
|
|
|
|
|
"有真道德,必生真胆量。凡怕天怕地怕人怕鬼的人,必是心中有鬼,必是品行不端。--宣永光",
|
|
|
|
|
"多听,少说,接受每一个人的责难,但是保留你的最后裁决。--莎士比亚",
|
|
|
|
|
"沉默较之言不由衷的话更有益于社交。--蒙田",
|
|
|
|
|
"人生就象弈棋,一步失误,全盘皆输,这是令人悲哀之事;而且人生还不如弈棋,不可能再来一局,也不能悔棋。--弗洛伊德",
|
|
|
|
|
"在你发怒的时候,要紧闭你的嘴,免得增加你的怒气。--苏格拉底",
|
|
|
|
|
"如烟往事俱忘却,心底无私天地宽。--陶铸",
|
|
|
|
|
"路是脚踏出来的,历史是人写出来的。人的每一步行动都在书写自己的历史。--吉鸿昌",
|
|
|
|
|
"我们活着不能与草木同腐,不能醉生梦死,枉度人生,要有所作为!--方志敏",
|
|
|
|
|
"思而后行,以免做出蠢事。因为草率的动作和言语,均是卑劣的特征。--毕达哥拉斯",
|
|
|
|
|
"凡事只要看得淡些,就没有什么可忧虑的了;只要不因愤怒而夸大事态,就没有什么事情值得生气的了。--屠格涅夫",
|
|
|
|
|
"谁若想在困厄时得到援助,就应在平日待人以宽。--萨迪",
|
|
|
|
|
"人生应该如蜡烛一样,从顶燃到底,一直都是光明的。--萧楚女",
|
|
|
|
|
"你在两个仇人之间说话要有分寸,以免他们和好后你将无地自容。--萨迪",
|
|
|
|
|
"为了在生活中努力发挥自己的作用,热爱人生吧!--罗丹",
|
|
|
|
|
"人生有两出悲剧。一是万念俱灰;另一是踌躇满志。--萧伯纳",
|
|
|
|
|
"不良的习惯会随时阻碍你走向成名、获利和享乐的路上去。--莎士比亚",
|
|
|
|
|
"人喜欢习惯,因为造它的就是自己。--萧伯纳",
|
|
|
|
|
"受惠的人,必须把那恩惠常藏心底,但是施恩的人则不可记住它。--西塞罗",
|
|
|
|
|
"习惯,我们每个人或多或少都是它的奴隶。--高汀",
|
|
|
|
|
"容易发怒,是品格上最为显着的弱点。--但丁",
|
|
|
|
|
"不要对一切人都以不信任的眼光看待,但要谨慎而坚定。--德谟克里特",
|
|
|
|
|
"你要记住,永远要愉快地多给别人,少从别人那里拿取。--高尔基",
|
|
|
|
|
"工作就是人生的价值,人生的欢乐,也是幸福之所在。--罗丹",
|
|
|
|
|
"应当在朋友正是困难的时候给予帮助,不可在事情无望之后再说闲话。--伊索",
|
|
|
|
|
"心胸开阔:不要为令人不快的区区琐事而心烦意乱,悲观失望。--富兰克林",
|
|
|
|
|
"对一个尚未成熟的少年来讲,坏的伙伴比好的老师起的作用要大得多。--伊索",
|
|
|
|
|
"人应该支配习惯,而决不能让习惯支配人,一个人不能去掉他的坏习惯,那简直一文不值。--奥斯特洛夫斯基",
|
|
|
|
|
"人活着,总得有个坚定的信仰,不光是为了自己的衣食住行,还要对社会有所贡献。--张志新",
|
|
|
|
|
"砍头不要紧,只要主义真。杀了夏明翰,还有后来人。--夏明翰",
|
|
|
|
|
"在理论的政治的认识上,站稳着脚步,才不至于随时为某些现象或谣言而动摇自己的革命信仰!--方志敏",
|
|
|
|
|
"敌人只能砍下我们的头颅,决不能动摇我们的信仰!因为我们信仰的主义,仍是宇宙的真理!--方志敏",
|
|
|
|
|
"在行进时,也时时有人退伍,有人落荒,有人颓唐,有人叛变,然而只要无碍于进行,则越到后来,这队伍也就越成为纯粹、精锐的队伍了。--鲁迅",
|
|
|
|
|
"几个苍蝇咬几口,决不能羁留一匹英勇的奔马。--伏尔泰",
|
|
|
|
|
"决定一个人的一生,以及整个命运的,只是一瞬之间。--歌德",
|
|
|
|
|
"生气的时候,开口前先数到十,如果非常愤怒,先数到一百。--杰弗逊",
|
|
|
|
|
"人就个人而言终有一死,就整体而言则是不朽的。--艾普利亚",
|
|
|
|
|
"谁若游戏人生,他就一事无成;谁不主宰自己,永远是一个奴隶。--歌德",
|
|
|
|
|
"一个人应养成信赖自己的习惯,即使在最危急的时候,也要相信自己的勇敢与毅力。--拿破仑",
|
|
|
|
|
"始吾于人也,听其言而信其行。今吾于人也,听其言而观其行。--孔丘",
|
|
|
|
|
"单是说不行,要紧的是做。--鲁迅",
|
|
|
|
|
"你有信仰就年轻,疑惑就年老;有自信就年轻,畏惧就年老;有希望就年轻,绝望就年老;岁月使你皮肤起皱,但是失去了热忱,就损伤了灵魂。--卡耐基",
|
|
|
|
|
"我们必须有恒心,尤其要有自信力!我们必须相信我们的天赋是要用来作某种事情的,无论代价多麽大,这种事情必须作到。--居里夫人",
|
|
|
|
|
"为了争取将来的美好而牺牲了的人,都是一尊石质的雕像。--伏契克",
|
|
|
|
|
"信念是由一种愿望产生的,因为愿意相信才会相信,希望相信才会相信,有一种利益所在才会相信。--斯特林堡",
|
|
|
|
|
"最可怕的敌人,就是没有坚强的信念。--罗曼·罗兰",
|
|
|
|
|
"不奋苦而求速效,只落得少日浮夸,老来窘隘而已。--郑板桥",
|
|
|
|
|
"巨大的建筑,总是由一木一石叠起来的,我们何妨做做这一木一石呢?我时常做些零碎事,就是为此。--鲁迅",
|
|
|
|
|
"信仰是精神的劳动;动物是没有信仰的,野蛮人和原始人有的只是恐怖和疑惑。只有高尚的组织体,才能达到信仰。--契诃夫",
|
|
|
|
|
"勇敢和必胜的信念常使战斗得以胜利结束。--恩格斯",
|
|
|
|
|
"空谈之类,是谈不久,也谈不出什麽来的,它始终被事实的镜子照出原形,拖出尾巴而去。--鲁迅",
|
|
|
|
|
"信仰,是人们所必须的。什麽也不信的人不会有幸福。--雨果",
|
|
|
|
|
"一个人的活动,如果不是被高尚的思所鼓舞,那它是无益的、渺小的。--车尔尼雪夫斯基",
|
|
|
|
|
"要使人成为真正有教养的人,必须具备三个品质:渊博的知识、思维的习惯和高尚的情操。知识不多就是愚昧;不习惯于思维,就是粗鲁或蠢笨;没有高尚的情操,就是卑俗。--车尔尼雪夫斯基",
|
|
|
|
|
"不管怎样的事情,都请安静地愉快吧!这是人生。我们要依样地接受人生,勇敢地、大胆地,而且永远地微笑着。--卢森堡",
|
|
|
|
|
"人就个人而言终有一死,就整体而言则是不朽的。--艾普利亚",
|
|
|
|
|
"追上未来,抓住它的本质,把未来转变为现在。--车尔尼雪夫斯基",
|
|
|
|
|
"未来是光明而美丽的,爱它吧,向它突进,为它工作,迎接它,尽可能地使它成为现实吧!--车尔尼雪夫斯基",
|
|
|
|
|
"不参加变革社会的斗争,理想永远是一种幻影。--吴运铎",
|
|
|
|
|
"过于求速是做事上最大的危险之一。--培根",
|
|
|
|
|
"一个不注意小事情的人,永远不会成功大事业。--卡耐基",
|
|
|
|
|
"杀了"现在",也便杀了"将来"。————将来是子孙的时代。--鲁迅",
|
|
|
|
|
"少说些漂亮话,多做些日常平凡的事情……--列宁",
|
|
|
|
|
"每个人都知道,把语言化为行动,比把行动化为语言困难得多。--高尔基",
|
|
|
|
|
"使生活变成幻想,再把幻想化为现时。--居里夫人",
|
|
|
|
|
"要成就一件大事业,必须从小事做起。--列宁",
|
|
|
|
|
"谁为时代的伟大目标服务,并把自己的一生献给了为人类兄弟而进行的斗争,谁才是不朽的……--涅克拉索夫",
|
|
|
|
|
"宁要好梨一个,不要烂梨一筐。积极肯干和忠心耿耿的人即使只有两三个,也比十个朝气沉沉的人强。--列宁",
|
|
|
|
|
"判断一个人,不是根据他自己的表白或对自己的看法,而是根据他的行动。--列宁",
|
|
|
|
|
"每一点滴的进展都是缓慢而艰巨的,一个人一次只能着手解决一项有限的目标。--贝弗里奇",
|
|
|
|
|
"对一个人来说,所期望的不是别的,而仅仅是他能全力以赴和献身于一种美好事业。--爱因斯坦",
|
|
|
|
|
"把希望建筑在意欲和心愿上面的人们,二十次中有十九次都会失望。--大仲马",
|
|
|
|
|
"神圣的工作在每个人的日常事务里,理想的前途在于一点一滴做起。--谢觉哉",
|
|
|
|
|
"事业常成于坚忍,毁于急躁。--萨迪", ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YiBan:
|
|
|
|
|
def __init__(self, cookie, reminder, receivers=285116040):
|
|
|
|
|
self.cookie = cookie
|
|
|
|
|
self.user_id = '0'
|
|
|
|
|
self.list_id = self.get_list()
|
|
|
|
|
self.pub_area = ''
|
|
|
|
|
self.group_id = ''
|
|
|
|
|
self.get_joined()
|
|
|
|
|
self.money = self.get_money()
|
|
|
|
|
self.now_money = 0
|
|
|
|
|
self.reminder = reminder
|
|
|
|
|
self.receivers = receivers
|
|
|
|
|
|
|
|
|
|
def get_headers(self):
|
|
|
|
|
ua = UserAgent()
|
|
|
|
|
headers = {
|
|
|
|
|
'User-Agent': ua.random,
|
|
|
|
|
'Cookie': self.cookie
|
|
|
|
|
}
|
|
|
|
|
return headers
|
|
|
|
|
|
|
|
|
|
def add(self):
|
|
|
|
|
"""
|
|
|
|
|
发布动态
|
|
|
|
|
"""
|
|
|
|
|
url = 'http://www.yiban.cn/feed/add'
|
|
|
|
|
data = {
|
|
|
|
|
'content': '',
|
|
|
|
|
'privacy': '2',
|
|
|
|
|
'dom': '.js-submit'
|
|
|
|
|
}
|
|
|
|
|
print("=== 即将开始发送动态 ===")
|
|
|
|
|
print("=== 8~10秒发送一条 ===")
|
|
|
|
|
num = 0
|
|
|
|
|
for i in range(1, 11):
|
|
|
|
|
try:
|
|
|
|
|
data['content'] = random.choice(words)
|
|
|
|
|
add_res = requests.post(url=url,
|
|
|
|
|
data=data,
|
|
|
|
|
headers=self.get_headers()
|
|
|
|
|
).json()
|
|
|
|
|
if add_res['code'] == 200:
|
|
|
|
|
num += 1
|
|
|
|
|
print('已发送%d条动态(在手机端给自己的动态点赞可以获得更多网薪哦!)' % num)
|
|
|
|
|
time.sleep(random.randint(8, 10))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def get_user_id(self):
|
|
|
|
|
url = 'http://www.yiban.cn/ajax/my/getLogin'
|
|
|
|
|
info = requests.post(url=url, headers=self.get_headers()).json()
|
|
|
|
|
self.user_id = info['data']['user']['id']
|
|
|
|
|
|
|
|
|
|
def get_list(self):
|
|
|
|
|
try:
|
|
|
|
|
url = 'http://www.yiban.cn/feed/list'
|
|
|
|
|
self.get_user_id()
|
|
|
|
|
data = {
|
|
|
|
|
'user_id': self.get_user_id(),
|
|
|
|
|
'lastid': '0',
|
|
|
|
|
'num': '10',
|
|
|
|
|
'scroll': '1'
|
|
|
|
|
}
|
|
|
|
|
info = requests.post(url=url, data=data, headers=self.get_headers()).json()
|
|
|
|
|
list_id = []
|
|
|
|
|
for item in info['data'][:6]:
|
|
|
|
|
list_id.append(item['_id'])
|
|
|
|
|
return list_id
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
return []
|
|
|
|
|
|
|
|
|
|
def up(self):
|
|
|
|
|
"""
|
|
|
|
|
点赞
|
|
|
|
|
"""
|
|
|
|
|
url = 'http://www.yiban.cn/feed/up'
|
|
|
|
|
data = {
|
|
|
|
|
'id': 0
|
|
|
|
|
}
|
|
|
|
|
print("===开始点赞===")
|
|
|
|
|
for id in self.list_id:
|
|
|
|
|
try:
|
|
|
|
|
data['id'] = id
|
|
|
|
|
up_rec = requests.post(url=url,
|
|
|
|
|
data=data,
|
|
|
|
|
headers=self.get_headers()).json()
|
|
|
|
|
# print(up_rec)
|
|
|
|
|
if up_rec['code']:
|
|
|
|
|
print('点赞成功!')
|
|
|
|
|
time.sleep(random.randint(2, 3))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def add_article(self):
|
|
|
|
|
url = 'http://ymm.yiban.cn/article/index/add'
|
|
|
|
|
data = {
|
|
|
|
|
'title': '',
|
|
|
|
|
'content': '',
|
|
|
|
|
'kind': '1',
|
|
|
|
|
'agree': '1'
|
|
|
|
|
}
|
|
|
|
|
print('===开始发表易喵喵===')
|
|
|
|
|
for i in range(3):
|
|
|
|
|
try:
|
|
|
|
|
data['title'] = random.choice(title)
|
|
|
|
|
data['content'] = '<p>' + random.choice(words) + '</p>'
|
|
|
|
|
article_rc = requests.post(url=url,
|
|
|
|
|
headers=self.get_headers(),
|
|
|
|
|
data=data).json()
|
|
|
|
|
# print(article_rc)
|
|
|
|
|
if article_rc['code'] == 200:
|
|
|
|
|
print('发送成功!')
|
|
|
|
|
time.sleep(random.randint(2, 3))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def comment(self):
|
|
|
|
|
url = 'http://www.yiban.cn/feed/createComment'
|
|
|
|
|
data = {
|
|
|
|
|
'id': '',
|
|
|
|
|
'content': '',
|
|
|
|
|
}
|
|
|
|
|
for id in self.list_id:
|
|
|
|
|
try:
|
|
|
|
|
data['content'] = random.choice(words)
|
|
|
|
|
data['id'] = id
|
|
|
|
|
comment_rc = requests.post(url=url, data=data, headers=self.get_headers()).json()
|
|
|
|
|
if comment_rc['code']:
|
|
|
|
|
print('评论发送成功')
|
|
|
|
|
time.sleep(random.randint(2, 3))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def get_joined(self):
|
|
|
|
|
"""
|
|
|
|
|
获取puid 和 pub_area
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
try:
|
|
|
|
|
url = 'http://www.yiban.cn/ajax/group/getJoined'
|
|
|
|
|
info = requests.post(url=url, headers=self.get_headers()).json()
|
|
|
|
|
for item in info['data']:
|
|
|
|
|
# puid
|
|
|
|
|
self.group_id = item['user_id']
|
|
|
|
|
self.pub_area = item['id']
|
|
|
|
|
break
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def add_votes(self):
|
|
|
|
|
url = 'http://www.yiban.cn/vote/vote/add'
|
|
|
|
|
self.get_joined()
|
|
|
|
|
print('===开始发送投票===')
|
|
|
|
|
for i in range(4):
|
|
|
|
|
try:
|
|
|
|
|
data = {
|
|
|
|
|
"puid": self.group_id,
|
|
|
|
|
"scope_ids": self.pub_area,
|
|
|
|
|
"title": random.choice(title),
|
|
|
|
|
"subjectTxt": str(random.randint(1, 99999)),
|
|
|
|
|
"subjectPic": "",
|
|
|
|
|
"options_num": "3",
|
|
|
|
|
"scopeMin": "1",
|
|
|
|
|
"scopeMax": "1",
|
|
|
|
|
"minimum": "1",
|
|
|
|
|
"voteValue": "2021-8-01 20:31",
|
|
|
|
|
"voteKey": "2",
|
|
|
|
|
"public_type": "0",
|
|
|
|
|
"isAnonymous": "1",
|
|
|
|
|
"voteIsCaptcha": "0",
|
|
|
|
|
"istop": "1",
|
|
|
|
|
"sysnotice": "2",
|
|
|
|
|
"isshare": "1",
|
|
|
|
|
"rsa": "1",
|
|
|
|
|
"dom": ".js-submit",
|
|
|
|
|
"group_id": self.pub_area,
|
|
|
|
|
"subjectTxt_1": "1",
|
|
|
|
|
"subjectTxt_2": "2",
|
|
|
|
|
"subjectTxt_3": "3",
|
|
|
|
|
}
|
|
|
|
|
votes_rc = requests.post(url=url, data=data, headers=self.get_headers()).json()
|
|
|
|
|
if votes_rc['code'] == 200:
|
|
|
|
|
print('发起成功!')
|
|
|
|
|
time.sleep(random.randint(9, 10))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def act_vote(self):
|
|
|
|
|
"""
|
|
|
|
|
自动投票
|
|
|
|
|
"""
|
|
|
|
|
print('===开始投票===')
|
|
|
|
|
url = 'https://www.yiban.cn/vote/vote/act'
|
|
|
|
|
vote_ids = self.get_vote_id()
|
|
|
|
|
for vote_id in vote_ids:
|
|
|
|
|
try:
|
|
|
|
|
data = {
|
|
|
|
|
'puid': self.group_id,
|
|
|
|
|
'group_id': self.pub_area,
|
|
|
|
|
'vote_id': vote_id[0],
|
|
|
|
|
'actor_id': self.user_id,
|
|
|
|
|
'voptions_id': vote_id[1],
|
|
|
|
|
'minimum': '1',
|
|
|
|
|
'scopeMax': '1',
|
|
|
|
|
}
|
|
|
|
|
art_rc = requests.post(url=url, data=data, headers=self.get_headers()).json()
|
|
|
|
|
if art_rc['code'] == 200:
|
|
|
|
|
print('投票成功')
|
|
|
|
|
time.sleep(random.randint(2, 3))
|
|
|
|
|
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def get_vote_id(self):
|
|
|
|
|
url = 'http://www.yiban.cn/newgroup/indexPub/group_id/' + self.pub_area + '/puid/' + self.group_id
|
|
|
|
|
html = requests.get(url=url, headers=self.get_headers()).text
|
|
|
|
|
html = etree.HTML(html)
|
|
|
|
|
infos = html.xpath('//div/li/a[@target="_blank"]/@href')
|
|
|
|
|
status = html.xpath('//div/li/a/div[1]/span/text()')
|
|
|
|
|
vote_ids = []
|
|
|
|
|
for i in range(len(status)):
|
|
|
|
|
if status[i] == '投票中':
|
|
|
|
|
vote_id = infos[i].split('/')[5]
|
|
|
|
|
id = self.get_vote_detail(vote_id)
|
|
|
|
|
vote_ids.append((vote_id, id))
|
|
|
|
|
time.sleep(random.randint(2, 3))
|
|
|
|
|
return vote_ids
|
|
|
|
|
|
|
|
|
|
def get_vote_detail(self, vote_id):
|
|
|
|
|
url = 'https://www.yiban.cn/vote/vote/getVoteDetail'
|
|
|
|
|
data = {"vote_id": vote_id,
|
|
|
|
|
"uid": self.user_id,
|
|
|
|
|
"puid": self.group_id,
|
|
|
|
|
"pagetype": "1",
|
|
|
|
|
"group_id": self.pub_area,
|
|
|
|
|
"actor_id": self.user_id,
|
|
|
|
|
"top_power": "f",
|
|
|
|
|
"edit_power": "t",
|
|
|
|
|
"end_power": "f",
|
|
|
|
|
"del_power": "t",
|
|
|
|
|
"block_power": "f",
|
|
|
|
|
"isSchoolVerify": "1",
|
|
|
|
|
"is_public": "f",
|
|
|
|
|
"is_anonymous": "t",
|
|
|
|
|
"token": "",
|
|
|
|
|
"out_power": "t",
|
|
|
|
|
"isMember": "",
|
|
|
|
|
"url[getVoteDetail]": "vote/vote/getVoteDetail",
|
|
|
|
|
"url[output]": "/vote/Expand/output",
|
|
|
|
|
"url[getCommentDetail]": "vote/vote/getCommentDetail",
|
|
|
|
|
"url[addComment]": "vote/vote/addComment",
|
|
|
|
|
"url[editLove]": "vote/vote/editLove",
|
|
|
|
|
"url[vote]": "vote/vote/act",
|
|
|
|
|
"url[setIsTop]": "vote/Expand/setIsTop",
|
|
|
|
|
"url[setManualEndVote]": "vote/Expand/setManualEndVote",
|
|
|
|
|
"url[delVote]": "vote/Expand/delVote",
|
|
|
|
|
"url[delComment]": "vote/vote/delComment",
|
|
|
|
|
"url[shieldVote]": "vote/Expand/shieldVote",
|
|
|
|
|
"url[getAnonymous]": "vote/Expand/getAnonymous",
|
|
|
|
|
"url[userInfo]": "user/index/index",
|
|
|
|
|
"isLogin": "1",
|
|
|
|
|
"isOrganization": "0",
|
|
|
|
|
"ispublic": "0", }
|
|
|
|
|
|
|
|
|
|
infos = requests.post(url=url, data=data, headers=self.get_headers()).json()
|
|
|
|
|
for info in infos['data']['option_list']:
|
|
|
|
|
id = info['id']
|
|
|
|
|
return id
|
|
|
|
|
|
|
|
|
|
def add_topic(self):
|
|
|
|
|
url = 'https://www.yiban.cn/forum/article/addAjax'
|
|
|
|
|
print('==开始发表话题==')
|
|
|
|
|
for item in range(10):
|
|
|
|
|
try:
|
|
|
|
|
data = {
|
|
|
|
|
"puid": self.group_id,
|
|
|
|
|
"pubArea": self.pub_area,
|
|
|
|
|
"title": random.choice(title),
|
|
|
|
|
"content": "<p>" + random.choice(words) + "</p>",
|
|
|
|
|
"isNotice": "false",
|
|
|
|
|
"dom": ".js-submit",
|
|
|
|
|
}
|
|
|
|
|
topic_rc = requests.post(url=url, headers=self.get_headers(), data=data).json()
|
|
|
|
|
# print(topic_rc)
|
|
|
|
|
if topic_rc['code'] == 200:
|
|
|
|
|
print('发送成功!')
|
|
|
|
|
time.sleep(random.randint(5, 6))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def see_others(self):
|
|
|
|
|
urls = ["http://www.yiban.cn/user/index/index/user_id/32555840",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32600222",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32614980",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33799157",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33811555",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33811573",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33811607",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33811671",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33811701",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33811867",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33812107",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33812177",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33812669",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33812747",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33813381",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33813819",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33817217",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33830251",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33830285",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/33863669",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/1899126",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32512442",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32512946",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32513282",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32516424",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32516684",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32517610",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32520634",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32521256",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32522834",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32524104",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32524100",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32525362",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32525710",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32526588",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32532154",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32532374",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32552780",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32553426",
|
|
|
|
|
"http://www.yiban.cn/user/index/index/user_id/32555650", ]
|
|
|
|
|
print('==开始看其他小伙伴==')
|
|
|
|
|
for url in urls:
|
|
|
|
|
try:
|
|
|
|
|
requests.get(url=url, headers=self.get_headers())
|
|
|
|
|
print("看望了一位小伙伴!")
|
|
|
|
|
time.sleep(random.randint(2, 3))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def through_page(self):
|
|
|
|
|
"""
|
|
|
|
|
浏览班级群主页
|
|
|
|
|
"""
|
|
|
|
|
url_list = ["http://www.yiban.cn/newgroup/indexPub/group_id/971442/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971436/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971428/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971424/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971414/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971404/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971392/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971386/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971372/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971366/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971356/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971350/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971340/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971332/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971330/puid/1899126",
|
|
|
|
|
"http://www.yiban.cn/newgroup/indexPub/group_id/971326/puid/1899126", ]
|
|
|
|
|
print('===开始访问班级主页===')
|
|
|
|
|
for url in url_list:
|
|
|
|
|
try:
|
|
|
|
|
requests.get(url=url, headers=self.get_headers())
|
|
|
|
|
print('访问班级主页成功!')
|
|
|
|
|
time.sleep(random.randint(1, 2))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def get_money(self):
|
|
|
|
|
"""
|
|
|
|
|
获取网薪
|
|
|
|
|
"""
|
|
|
|
|
url = 'http://www.yiban.cn/user/index/index/user_id/' + self.user_id
|
|
|
|
|
try:
|
|
|
|
|
html = requests.get(url=url, headers=self.get_headers()).text
|
|
|
|
|
html = etree.HTML(html)
|
|
|
|
|
money = html.xpath('//*[@id="user-money"]/text()')[0]
|
|
|
|
|
print('===您现在的网薪是%s===' % money)
|
|
|
|
|
self.now_money = int(money)
|
|
|
|
|
return int(money)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def calculate_money(self):
|
|
|
|
|
"""
|
|
|
|
|
计算获取的网薪
|
|
|
|
|
"""
|
|
|
|
|
get_money = self.now_money - self.money
|
|
|
|
|
print('===一共刷到了%d的网薪哦===' % get_money)
|
|
|
|
|
content = '刷取成功!一共刷到' + str(get_money) + '的网薪', '刷的太少了说明需要更新Cookie了哦'
|
|
|
|
|
self.reminder.send(title, content, self.receivers)
|
|
|
|
|
|
|
|
|
|
def get_list_ajax(self):
|
|
|
|
|
"""
|
|
|
|
|
获取文章列表
|
|
|
|
|
:return:
|
|
|
|
|
"""
|
|
|
|
|
# get channel id
|
|
|
|
|
url = 'http://www.yiban.cn/forum/api/getListAjax'
|
|
|
|
|
data = {
|
|
|
|
|
'puid': self.group_id,
|
|
|
|
|
'ground_id': self.pub_area
|
|
|
|
|
}
|
|
|
|
|
channel_id = requests.post(url=url, data=data, headers=self.get_headers()).json()['data']['channel_id']
|
|
|
|
|
url = 'http://www.yiban.cn/forum/article/listAjax'
|
|
|
|
|
data = {
|
|
|
|
|
"channel_id": channel_id,
|
|
|
|
|
"puid": self.group_id,
|
|
|
|
|
"page": 1,
|
|
|
|
|
"size": 10,
|
|
|
|
|
"orderby": 'updateTime',
|
|
|
|
|
"Sections_id": -1,
|
|
|
|
|
"need_notice": 0,
|
|
|
|
|
"group_id": self.pub_area,
|
|
|
|
|
"my": 0,
|
|
|
|
|
}
|
|
|
|
|
topic_list = requests.post(url=url, data=data, headers=self.get_headers()).json()['data']['list']
|
|
|
|
|
return topic_list
|
|
|
|
|
|
|
|
|
|
def comment_topic(self):
|
|
|
|
|
print('===开始评论话题===')
|
|
|
|
|
topic_list = self.get_list_ajax()
|
|
|
|
|
for item in topic_list:
|
|
|
|
|
try:
|
|
|
|
|
url = 'https://www.yiban.cn/forum/reply/addAjax'
|
|
|
|
|
data = {
|
|
|
|
|
'channel_id': item['Channel_id'],
|
|
|
|
|
'puid': self.group_id,
|
|
|
|
|
'article_id': item['id'],
|
|
|
|
|
'content': 66,
|
|
|
|
|
'reply_id': 0,
|
|
|
|
|
'syncFeed': 1,
|
|
|
|
|
}
|
|
|
|
|
rc = requests.post(url=url, data=data, headers=self.get_headers()).json()
|
|
|
|
|
if rc['code'] == 200:
|
|
|
|
|
print('评论成功!')
|
|
|
|
|
time.sleep(random.randint(2, 3))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
print("===自动登陆成功===")
|
|
|
|
|
# 浏览别人的空间
|
|
|
|
|
self.see_others()
|
|
|
|
|
self.get_money()
|
|
|
|
|
# 浏览班级主页
|
|
|
|
|
self.through_page()
|
|
|
|
|
self.get_money()
|
|
|
|
|
# 添加动态
|
|
|
|
|
self.add()
|
|
|
|
|
# 发表话题
|
|
|
|
|
self.add_topic()
|
|
|
|
|
self.get_money()
|
|
|
|
|
print('++进入刷投票模式++')
|
|
|
|
|
for i in range(3):
|
|
|
|
|
try:
|
|
|
|
|
# 发表投票
|
|
|
|
|
self.add_votes()
|
|
|
|
|
# 参与投票
|
|
|
|
|
self.act_vote()
|
|
|
|
|
self.get_money()
|
|
|
|
|
time.sleep(10)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
self.comment_topic()
|
|
|
|
|
self.get_money()
|
|
|
|
|
self.calculate_money()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
print('易班永动机启动!')
|
|
|
|
|
reminder = Reminder()
|
|
|
|
|
reminder.register_()
|
|
|
|
|
title = '易班网薪刷取结果'
|
|
|
|
|
content = ''
|
|
|
|
|
while 1:
|
|
|
|
|
data = read_data()
|
|
|
|
|
time_1 = time.time()
|
|
|
|
|
for qq, cookie in zip(data['qq'], data['cookie']):
|
|
|
|
|
rec = int(qq)
|
|
|
|
|
try:
|
|
|
|
|
yiban = YiBan(cookie, reminder, rec)
|
|
|
|
|
yiban.run()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
write_error(e)
|
|
|
|
|
try:
|
|
|
|
|
yiban.calculate_money()
|
|
|
|
|
except:
|
|
|
|
|
reminder.send('错误Error!', str(e) + '有人填写非法信息请检查', 285116040)
|
|
|
|
|
time.sleep(3600 * 12)
|