1 Star 0 Fork 0

鲁江洋/autoYiban

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ascension_yiban_egpa.py 33.36 KB
一键复制 编辑 原始数据 按行查看 历史
鲁江洋 提交于 2021-04-24 14:11 . add
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
#!/usr/bin/python3
# _*_ coding:utf-8 -*-
# __author__ = '鲁江洋'
# __time__ = '2020/5/28 16:21'
from package_all import *
from login_yiban import *
template = __import__("template", fromlist=("template",))
from bullshit import *
from setting import *
from log import *
from retrying import retry
log = Loggers(level='warning')
def retry_if_result_none(result):
#911输入图片验证码,203一天后重试,一分钟
if result == "911" or result == 203 or result == '444':
return False
#201点赞过,202投票过
elif result == "200" or result == 200 or result == None or result == 201 or result == "202":
return False
else:
print("正在重试中", result)
return True
# TODO:提升egpa
class Ascension_yiban_egpa(object, metaclass=getattr(template, "MyMetaClass")):
'''
刷egpa
'''
list1 = ['今日欣赏', '今日推荐', '', '我发现了一个好的', '', '奔跑吧', "咆哮吧", 'go']
list2 = ["你对自己说早晚安了吗", "今天你对自己说早晚安了吗", "请收下这份祝福", "请收下他"]
@classmethod
def get_id(cls, header, cookies, person, group_id="", puid_id=""):
# 测试
if pattern == "2":
if group_id == "" or puid_id == "":
raise Exception('You select 2 but you group_id and puid_id not assignment')
global class_grade
result = person.get('https://www.yiban.cn/my/group', cookies=cookies, headers=header).text
all_group_id = re.findall('/newgroup/indexPub/group_id/(\d+)/puid/\d+"><span>', result)
all_puid_id = re.findall('/newgroup/indexPub/group_id/\d+/puid/(\d+)"><span>', result)
all_class_grade = re.findall('<a href="/newgroup/indexPub/group_id/\d+/puid/\d+"><span>(.*?)</span></a>',
result)
print("id", all_group_id, all_puid_id, all_class_grade)
if pattern == "2":
print("指定id", puid_id, group_id)
if group_id not in all_group_id or puid_id not in all_puid_id:
raise Exception('You select 2 but your group_id and puid_id Seems wrong')
else:
yield group_id, puid_id, all_class_grade[all_group_id.index(group_id)]
else:
for index, i in enumerate(all_group_id):
if pattern == "3":
if re.search("{}".format(sign), all_class_grade[index]) == None:
continue
group_id = i
puid_id = all_puid_id[index]
class_grade = all_class_grade[index]
yield group_id, puid_id, class_grade
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,wait_random_max=20000)
def publish_article(cls, header, cookies, person, group_id, puid_id):
'''
发布话题
:return:
'''
result = dispath([])
# print("publish_article,result")
if result[0] == "":
title = random.choice(cls.list2)
content = result[1]
else:
title = random.choice(cls.list1) + result[0]
content = result[1]
data = {
"puid": puid_id,
"pubArea": group_id,
"title": title,
"content": "<p>{}</p>".format(content.replace(' ', '&nbsp;')),
"isNotice": "false",
"dom": ".js-submit",
}
response = person.post('https://www.yiban.cn/forum/article/addAjax', cookies=cookies, headers=header, data=data,
verify=False).json()
# print(response)
if response['code'] != 200:
log.logger.warning(str(response) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(
person) + " " + str(group_id) + " " + str(puid_id))
print(response)
return response['code']
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def vote(cls, header, cookies, person, group_id, puid_id):
'''
投票
:return:
'''
result = dispath([1, 8])
data = {
"puid": puid_id,
"scope_ids": group_id,
"title": result[0],
"subjectTxt": result[1],
"subjectPic": "",
"options_num": "3",
"scopeMin": "1",
"scopeMax": "1",
"minimum": "1",
"voteValue": time.strftime("%Y-%m-%d %H:%M", time.localtime(1893427200)),
"voteKey": "2",
"public_type": "0",
"isAnonymous": "1",
"voteIsCaptcha": "0",
"istop": "1",
"sysnotice": "2",
"isshare": "1",
"rsa": "1",
"dom": ".js-submit",
"group_id": group_id,
"subjectTxt_1": "{}{}".format(random.choice(['优质', 'good', '优秀', '优', '好', '挺好', '不错', '真好', '哇,优秀']),
result[0]),
"subjectTxt_2": "{}{}".format(random.choice(['一般', '还好', '好行', '凑合', '可以', 'common', '还好啦']), result[0]),
"subjectTxt_3": "{}{}".format(random.choice(['差劲', '差', '不行', 'low', '真菜', '菜鸡', '菜极了', '还没有我编的好']),
result[0]),
}
result = person.post('http://www.yiban.cn/vote/vote/add', cookies=cookies, data=data, headers=header,
verify=False).json()
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
return result['code']
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def Release_the_dynamic(cls, header, cookies, person, group_id, puid_id):
'''
发布动态
:return:
'''
result = dispath([7])
data = {
"content": result[1],
"privacy": "0",
"dom": ".js-submit",
}
result = person.post('http://www.yiban.cn/feed/add', headers=header, data=data, cookies=cookies,
verify=False).json()
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
return result['code']
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def post_Writing_blog(cls, header, cookies, person, login_taken, group_id, puid_id):
'''
发布miao
'''
result = dispath([])
if result[0] == "":
title = random.choice(cls.list2)
content = result[1]
else:
title = random.choice(cls.list1) + result[0]
content = result[1]
data = {
"agree": "true",
"content": "<p>{}</p>".format(content.replace(' ', '&nbsp;')),
"kind": "1",
"title": title,
}
header['loginToken'] = login_taken
# print(header)
response = person.post('http://ymm.yiban.cn/article/index/add', headers=header, cookies=cookies, json=data,
verify=False).json()
# print(response)
if response['code'] != 200:
log.logger.warning(
str(response) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(
person) + " " + str(
group_id) + " " + str(puid_id))
return response['code']
# print(response.text)
@classmethod
def logs(cls, header, cookies, person, token, group_id, puid_id):
'''
发布博客
:return:
'''
result = dispath([])
if result[0] == "":
title = random.choice(cls.list2)
content = result[1]
else:
title = random.choice(cls.list1) + result[0]
content = result[1]
data = {
"title": title,
"content": content,
"ranges": "1",
"type": "1",
"token": token,
"ymm": "1",
"dom": ".js-submit",
}
response = person.post('https://www.yiban.cn/blog/blog/addblog', cookies=cookies, headers=header, data=data,
verify=False).json()
print(response)
if response['code'] != 200:
log.logger.warning(str(response) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(
person) + " " + str(group_id) + " " + str(puid_id))
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def sign_in(cls, header, cookies, person, group_id, puid_id):
'''
自动签到
:param header:
:param person:
:return:
'''
result = person.post('https://www.yiban.cn/ajax/checkin/checkin', cookies=cookies, headers=header,
verify=False).json()
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
else:
data = {
"optionid[]": re.search('\d\d+', result['data']['survey']).group(),
"input": ""
}
# print("正在填写问卷调查")
result = person.post('https://www.yiban.cn/ajax/checkin/answer', cookies=cookies, data=data, headers=header,
verify=False).json()
print(result)
if result['code'] != 200:
log.logger.warning(str(result) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(
person) + " " + str(group_id) + " " + str(puid_id))
return result['code']
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def give_a_like(cls, header, cookies, person, group_id, puid_id):
'''
微社区点赞
:return:
'''
data = {
"puid": puid_id,
"group_id": group_id,
}
# 获取channel_id
result = person.post('https://www.yiban.cn/forum/api/getListAjax', cookies=cookies, headers=header, data=data,
verify=False).json()
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
# print("give_a_like,result0",result)
channel_id = result['data']['channel_id']
data = {
"channel_id": channel_id,
"puid": puid_id,
"page": 1,
"size": 10,
"orderby": "updateTime",
"Sections_id": -1,
"need_notice": 0,
"group_id": group_id,
"my": 0,
}
# 获取文章列表
result = person.post('https://www.yiban.cn/forum/article/listAjax', cookies=cookies, data=data, headers=header,
verify=False).json()
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
else:
for i in result['data']['list']:
article_id = i['id']
channel_id = i['Channel_id']
data = {
"article_id": article_id,
"channel_id": channel_id,
"puid": puid_id,
}
result = person.post('https://www.yiban.cn/forum/article/upArticleAjax', cookies=cookies, data=data,
headers=header, verify=False).json()
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(
person) + " " + str(
group_id) + " " + str(puid_id))
return result['code']
content = dispath([1, 8])
data = {
"channel_id": channel_id,
"puid": puid_id,
"article_id": article_id,
"content": content[1],
"reply_id": 0,
"syncFeed": 1,
"isAnonymous": 0,
}
result = person.post('https://www.yiban.cn/forum/reply/addAjax', cookies=cookies, data=data,
headers=header, verify=False).json()
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(
person) + " " + str(
group_id) + " " + str(puid_id))
return result['code']
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def auto_vote(cls, header, cookies, person, group_id, puid_id):
'''
自动投票
:return:
'''
result = person.get('http://www.yiban.cn/newgroup/showMorePub/puid/{}/group_id/{}/type/3/page/1'.format(puid_id, group_id),
cookies=cookies, headers=header, verify=False).text
uid = re.findall('/user/index/index/user_id/(\d+)"><i', result)[0]
id = re.findall('/vote/vote/showDetail/vote_id/(\d+)/puid/', result)
vote_id = [id[i - 1] for i in range(1, len(id) + 1) if i % 2 == 0]
for index, i in enumerate(vote_id):
data = {
"vote_id": i,
"uid": uid,
"puid": puid_id,
"pagetype": "1",
"group_id": group_id,
"actor_id": uid,
"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": "f",
"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",
}
# print(data)
result1 = person.post('https://www.yiban.cn/vote/vote/getVoteDetail', cookies=cookies, headers=header,
data=data, verify=False).json()
if result1['code'] != 200:
log.logger.warning(
str(result1) + " " + str(header) + " " + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
# print("auto_vote,result",result1)
voptions_id = result1['data']['option_list'][0]['id']
# print(voptions_id)
data = {
"puid": puid_id,
"group_id": group_id,
"vote_id": i,
"actor_id": uid,
"voptions_id": voptions_id,
"minimum": "1",
"scopeMax": "1",
}
# print("最终",data)
result2 = person.post('https://www.yiban.cn/vote/vote/act', cookies=cookies, headers=header, data=data,
verify=False).json()
# print("auto_vote,reuslt2",result2)
if result2['code'] != 200:
log.logger.warning(
str(result2) + " " + str(header) + " " + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
if result2['message'] == "已投过票":
break
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def visit_group(cls, header, cookies, person, group_id, puid_id):
'''
访问群主页
:return:
'''
result = person.post('http://www.yiban.cn/newgroup/indexPub/group_id/{}/puid/{}'.format(group_id, puid_id),
cookies=cookies, headers=header, verify=False)
if result.status_code != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def auto_like_dynamic_state(cls, header, cookies, person, group_id, puid_id):
'''
动态,自动点赞,评论,同情
:param header:
:param person:
:return:
'''
for i in range(1, 4):
if i == 1:
data = {
"num": 6,
"topic_content": "",
"scroll": i,
}
else:
data = {
"lastid": id,
"num": 6,
"topic_content": "",
"scroll": i,
}
for i in person.post('https://www.yiban.cn/feed/list', cookies=cookies, data=data, headers=header,
verify=False).json()['data']:
id = i['_id']
# 点赞
result = person.post('https://www.yiban.cn/feed/up', cookies=cookies, headers=header, data={"id": id},
verify=False).json()
# print(result)
if result['code'] != 200:
log.logger.warning(
str(result) + " " + str(header) + " " + str({"id": id}) + " " + str(cookies) + " " + str(
person) + " " + str(
group_id) + " " + str(puid_id))
return result['code']
print("auto_like_dynamic_state,result",result)
# 同情
result1 = person.post('https://www.yiban.cn/feed/down', cookies=cookies, headers=header,
data={"id": id}, verify=False).json()
# print(result1)
try:
if result1['code'] != 200:
log.logger.warning(
str(result1) + " " + str(header) + " " + str({"id": id}) + " " + str(cookies) + " " + str(
person) + " " + str(
group_id) + " " + str(puid_id))
except Exception as e:
log.logger.error("同情失败", str(header) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
return "700"
print("auto_like_dynamic_state,result1",result1)
# 评论
result2 = dispath([1, 7, 8])
try:
result3 = person.post('https://www.yiban.cn/feed/createComment', headers=header,
data={"id": id, "content": result2[1]}, verify=False)
if result3.text[0]=="<":
continue
result3 = result3.json()
if result3['code'] != 200:
log.logger.warning(
str(result3) + " " + str(header) + " " + str({"id": id, "content": result2[1]}) + " " + str(
cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
except Exception as e:
log.logger.error("该动态不存在", str(header) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
# return "700"
print("你好")
@classmethod
@retry(stop_max_attempt_number=5, retry_on_result=retry_if_result_none, wait_random_min=10000,
wait_random_max=20000)
def like_logs(cls, header, cookies, person, group_id, puid_id):
'''
点赞,评论,转载博客
:param header:
:param person:
:return:
'''
response = person.get(
'https://www.yiban.cn/newgroup/showMore/puid/{}/group_id/{}/type/3'.format(group_id, puid_id),
cookies=cookies, headers=header).text
all_uid = [re.search('\d\d\d\d+', i).group() for i in filter(lambda x: not x.startswith('j'),
etree.HTML(response).xpath(
'//ul[@class="user-list member-leader clearfix"]/li//@href'))]
# print("like_logs,all_uid",all_uid)
for index, i in enumerate(all_uid):
result1 = person.get('https://www.yiban.cn/blog/blog/getBlogList?page=1&size=10&uid={}'.format(i),
cookies=cookies, headers=header).json()
if result1['code'] != 200:
log.logger.warning(
str(result1) + " " + str(header) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
for j in result1['data']['list']:
blogid = j['id']
Mount_id = j['Mount_id']
oid = j['User_id']
result2 = person.get('https://www.yiban.cn/blog/blog/addlike?uid={}&blogid={}'.format(i, blogid),
cookies=cookies, headers=header).json()
# print("like_logs,result2",result2)
if result2['code'] != 200:
log.logger.warning(
str(result2) + " " + str(header) + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
return result2['code']
result = dispath([1, 8])
data = {
"blogid": blogid,
"oid": oid,
"mid": Mount_id,
"reply_user_id": 0,
"reply_comment_id": 0,
"content": result[1],
}
result3 = person.post('https://www.yiban.cn/blog/blog/addcomment', cookies=cookies, headers=header,
data=data).json()
# print("like_logs,result3",result3)
if result3['code'] != 200:
log.logger.warning(
str(result3) + " " + str(header) + " " + str(data) + " " + str(cookies) + " " + str(
person) + " " + str(
group_id) + " " + str(puid_id))
return result3['code']
result4 = person.get('https://www.yiban.cn/blog/blog/copyblog?blogid={}&suid={}&range=1'.format(i, oid),
headers=header, cookies=cookies).json()
if result4['code'] != 200:
log.logger.warning(
str(result4) + " " + str(header) + " " + " " + str(cookies) + " " + str(person) + " " + str(
group_id) + " " + str(puid_id))
return result4['code']
@classmethod
def show_echarts(cls):
dict1={}
if os.path.exists('./user_data.json'):
with open('./user_data.json',mode='r') as file:
read1 = json.loads(file.read())
for i,j in read1.items():
# print(i,j)
cookies=json.loads(j[0])
result = requests.get('https://www.yiban.cn/my/group', cookies=cookies, headers=cls.headers).text
all_group_id = re.findall('/newgroup/indexPub/group_id/(\d+)/puid/\d+"><span>', result)
all_puid_id = re.findall('/newgroup/indexPub/group_id/\d+/puid/(\d+)"><span>', result)
all_class_grade = re.findall(
'<a href="/newgroup/indexPub/group_id/\d+/puid/\d+"><span>(.*?)</span></a>',
result)
print(all_group_id)
print(all_puid_id)
print(all_class_grade)
for index,i in enumerate(all_group_id):
dict1['{}'.format(all_group_id[index])]=[all_puid_id[index],cookies,all_class_grade[index]]
time1=time.strftime('%Y-%m-%d %H-%M-%S', time.localtime(int(time.time())))
for i,j in dict1.items():
result = requests.post(
'http://www.yiban.cn/newgroup/indexPub/group_id/{}/puid/{}'.format(i, j[0]),
cookies=j[1], headers=cls.headers, verify=False).text
xpath_all = etree.HTML(result)
# 获取egpa值
egpa = xpath_all.xpath('//span[@class="member-number"][1]')[0].text.replace(' ','').split(':')[-1].replace('\n','').replace('\t','')
# 所属学校
school = xpath_all.xpath('/html/body/main/div/div/div/div[1]/section[1]/div[2]/div/span[2]/a')[0].text.replace(' ','')
# 班级
clas = xpath_all.xpath('/html/body/main/div/div/div/div[1]/section[1]/div[1]/div/h2')[0].text
print("egpa",egpa)
print("school",school)
print("clas",clas)
if egpa=="":
continue
if pattern=='3':
if clas.count(sign)==0:
continue
if not os.path.exists("./increase_egpa_log"):
os.mkdir('increase_egpa_log')
if not os.path.exists("./increase_egpa_log/{}.csv".format(time1)):
data1 = pd.DataFrame(columns=["学校", "班级", "egpa"])
data1.to_csv("./increase_egpa_log/{}.csv".format(time1), mode='w',index=False,header=True)
else:
pd.DataFrame({"学校":school,"班级":clas,"egpa":egpa},columns=["学校", "班级", "egpa"],index=[0]).to_csv("./increase_egpa_log/{}.csv".format(time1),header=False,mode='a+',index=False)
@classmethod
def show(cls):
from pyecharts import options as opts
from pyecharts.charts import Bar
for a, b, c in os.walk('increase_egpa_log'): # a代表所在根目录;b代表根目录下所有文件夹(以列表形式存在);c代表根目录下所有文件
for i in c:
try:
data = pd.read_csv('increase_egpa_log/{}'.format(i))
data = pd.DataFrame(data)
datatime = [i for i in data['班级']]
closing = [i for i in data['egpa']]
bar = (
Bar(init_opts=opts.InitOpts(width="1600px", height="900px",
animation_opts=opts.AnimationOpts(
animation_delay=500, animation_easing="cubicOut")))
.add_xaxis(datatime)
.add_yaxis("分数", closing, category_gap="50%", markpoint_opts=opts.MarkPointOpts(), is_selected=True)
.set_series_opts(itemstyle_opts={
"normal": {
"barBorderRadius": [6, 6, 6, 6],
"shadowColor": 'rgb(0, 160, 221)'
}}, markpoint_opts=opts.MarkPointOpts(
data=[
opts.MarkPointItem(type_="max", name="最大值"),
opts.MarkPointItem(type_="min", name="最小值"),
]),
markline_opts=opts.MarkLineOpts(
data=[
opts.MarkLineItem(type_="min", name="最小值"),
opts.MarkLineItem(type_="max", name="最大值")
]
))
.set_global_opts(title_opts=opts.TitleOpts(title="egpa分数", subtitle="指数"),
toolbox_opts=opts.ToolboxOpts(),
yaxis_opts=opts.AxisOpts(position="right", name="Y轴"),
datazoom_opts=opts.DataZoomOpts())
)
bar.render("increase_egpa_log/{}.html".format(i.split('.')[0]))
except Exception as e:
print(e,"表格异常")
def main():
# pass
# header,cookie, self.__person, group_id, puid_id
person = requests.Session()
# headers = {'x-requested-with': 'XMLHttpRequest', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36', 'loginToken': '726879089ea4c86bca5b010b6125fab3'}
# cookies = {'cookie-name': 'cookie-value', 'YB_SSID': 'ace3a24b40093b1fa8d492769a099073', 'yiban_user_token': '726879089ea4c86bca5b010b6125fab3', 'waf_cookie': '94cb9cfd-69ee-4dc7450ee91d3bde1ef9e96797a6063d6d99'}
cookies={'cookie-name': 'cookie-value', 'YB_SSID': 'e8cd859a39c6ee308d681681d49d2f1a',
'yiban_user_token': '8bdac0e1f65197e51c0159684c15d101',
'waf_cookie': '81b39ab3-4144-4dc15a42512aaf27adc592f1d097f8d62cac'}
headers={'x-requested-with': 'XMLHttpRequest',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
'loginToken': '8bdac0e1f65197e51c0159684c15d101'}
group_id = 1119481
puid_id = 24994440
# Ascension_yiban_egpa.publish_article(headers, cookies, person, group_id, puid_id)
# Ascension_yiban_egpa.auto_like_dynamic_state(headers, cookies, person, group_id, puid_id)
# Ascension_yiban_egpa.logs(headers, cookies, person, "63a6503a0ff5944159859f2813ca6cf2", group_id, puid_id)
# Ascension_yiban_egpa.sign_in(headers, cookies, person, group_id, puid_id)
# cookies={"cookie-name": "cookie-value", "YB_SSID": "e6239021c7d096f7adacf429ef553224", "yiban_user_token": "797d12a93d36d82deaa81f36fce3b9b5", "waf_cookie": "5fdaf84e-bef7-4bee49aeac7a6e476fd538e0fe8358f40bca"}
# "1593932130]
# headers={'x-requested-with': 'XMLHttpRequest',
# 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
# 'loginToken': '8d6a479edeea2f4e5a7d993b1ce50963'}
# # {'puid': '24994440', 'pubArea': '1119491', 'title': '今天你对自己说早晚安了吗', 'content': '<p>人一简单就快乐,一世故就变老。早安,少年们!</p>',
# # 'isNotice': 'false', 'dom': '.js-submit'}
# cookies={'cookie-name': 'cookie-value', 'YB_SSID': 'fce61e4c2eede7d06122f2e78da955fc',
# 'yiban_user_token': '8d6a479edeea2f4e5a7d993b1ce50963',
# 'waf_cookie': 'aa39a0fc-bcb0-495b4c92292680a38c8ef13f48c99dd15c88'}
Ascension_yiban_egpa.publish_article(headers,cookies, person, group_id, puid_id)
# def captcha(): # 图片验证码
# captcha_check_url = "https://www.yiban.cn/captcha/index?Tue%20Dec%2004%202018%2000:01:2" \
# "6%20GMT+0800%20(%E4%B8%AD%E5%9B%BD%E6%A0%87%E5%87%86%E6%97%B6%E9%97%B4)"
# captcha_check_respond = person.get(url=captcha_check_url)
# print(captcha_check_respond)
# captcha_content = captcha_check_respond.content # 转换类型
# fb = open('captcha.jpg', 'wb') # 把字节类型转换为图片文件
# fb.write(captcha_content)
# fb.write(captcha_content)
# fb.close()
# check_in = input("请输入图片验证码>>>:")
# return check_in
if __name__ == '__main__':
# for i in range(20):
main()
# pass
# Ascension_yiban_egpa.show_echarts()
# Ascension_yiban_egpa.show()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/lu_jiang_yang/auto-yiban.git
git@gitee.com:lu_jiang_yang/auto-yiban.git
lu_jiang_yang
auto-yiban
autoYiban
master

搜索帮助