Compare commits

...

3 Commits

Author SHA1 Message Date
d77324b714 fix: 增加热刺和纽卡的预测 2023-10-07 14:18:43 +08:00
829ce230a1 fix: 修改忽略 2023-09-28 17:41:12 +08:00
b1a69bdd94 fix: 增加异常捕捉 2023-09-28 17:37:38 +08:00
4 changed files with 18 additions and 8 deletions

2
.gitignore vendored
View File

@@ -140,3 +140,5 @@ dmypy.json
# End of https://www.toptal.com/developers/gitignore/api/python # End of https://www.toptal.com/developers/gitignore/api/python
.idea .idea
cqhttp/data cqhttp/data
cqhttp/device.json
cqhttp/session.token

Binary file not shown.

View File

@@ -30,7 +30,7 @@ async def handle_first_receive(bot: Bot, event: Event, state: T_State, args= Com
for item in saishiContent: for item in saishiContent:
if item.html.find("英超") >= 0: if item.html.find("英超") >= 0:
if item.html.find("阿森纳") >= 0 or item.html.find("曼城") >= 0 or item.html.find("曼联") >= 0 or item.html.find( if item.html.find("阿森纳") >= 0 or item.html.find("曼城") >= 0 or item.html.find("曼联") >= 0 or item.html.find(
"利物浦") >= 0 or item.html.find("切尔西") >= 0: "利物浦") >= 0 or item.html.find("切尔西") >= 0 or item.html.find("热刺") >= 0 or item.html.find("纽卡") >= 0:
rouneNum, vsStr = parserSaishiItem(item.html) rouneNum, vsStr = parserSaishiItem(item.html)
if rouneNum not in vsMap.keys(): if rouneNum not in vsMap.keys():
vsMap[rouneNum] = [] vsMap[rouneNum] = []

View File

@@ -9,7 +9,8 @@ from nonebot import on_command
from nonebot.rule import to_me from nonebot.rule import to_me
from requests_html import HTMLSession, HTML from requests_html import HTMLSession, HTML
import json import json
from selenium.webdriver import Chrome, ChromeOptions from nonebot import logger
# from selenium.webdriver import Chrome, ChromeOptions
tongjiCommand = on_command("统计", rule=to_me(), aliases={'微头条', 'tongji', 'tj'}, priority=10) tongjiCommand = on_command("统计", rule=to_me(), aliases={'微头条', 'tongji', 'tj'}, priority=10)
@@ -23,12 +24,19 @@ weitoutiaoMap = {"太能喵": 0, "小小": 0, "大帝强": 0, "叶小欢": 0}
""" """
@tongjiCommand.handle() @tongjiCommand.handle()
async def handle_first_receive(bot: Bot, event: Event, state: T_State, args= CommandArg()): async def handle_first_receive(bot: Bot, event: Event, state: T_State, args= CommandArg()):
# 清空原有的weitoutiaoMap中的统计结果 from nonebot.exception import MatcherException
for k,v in weitoutiaoMap.items(): try:
weitoutiaoMap[k] = 0 # 清空原有的weitoutiaoMap中的统计结果
getWeiToutiaoInfo() for k,v in weitoutiaoMap.items():
# 将上周的微头条考核结果发送给用户 weitoutiaoMap[k] = 0
await tongjiCommand.finish(str(weitoutiaoMap)) getWeiToutiaoInfo()
# 将上周的微头条考核结果发送给用户
await tongjiCommand.finish(str(weitoutiaoMap))
except MatcherException:
raise
except Exception as e:
logger.error(e)
print(e)
""" """
获取微头条数据信息 获取微头条数据信息