增加提醒的推送

This commit is contained in:
rm 2023-12-29 10:14:40 +08:00
parent 551da4b223
commit 5c99ced2cd
2 changed files with 11 additions and 14 deletions

View File

@ -8,6 +8,8 @@ import requests
import toml
from bs4 import BeautifulSoup
from notify import pushme, pushplus_bot
'''
0 0 15 * * ?
'''
@ -72,7 +74,10 @@ class PtOperation:
try:
# 打印结果
if "再次输入密码" in html and "submit" in html:
logger.info(f"现在 {text} 正在开放注册,请前往~")
remind_me = f"现在 {text} 正在开放注册,请前往~"
pushme("开注提醒" + section_name, remind_me)
pushplus_bot("开注提醒" + section_name, remind_me)
logger.info(remind_me)
else:
soup = BeautifulSoup(html, 'html.parser')
text_content = soup.find(class_='text').get_text()

View File

@ -73,7 +73,7 @@ push_config = {
'CHAT_URL': '', # synology chat url
'CHAT_TOKEN': '', # synology chat token
'PUSH_PLUS_TOKEN': '', # push+ 微信推送的用户令牌
'PUSH_PLUS_TOKEN': 'beacff77d6e44db9a803ced07f3a11cd', # push+ 微信推送的用户令牌
'PUSH_PLUS_USER': '', # push+ 微信推送的群组编码
'QMSG_KEY': '', # qmsg 酱的 QMSG_KEY
@ -102,11 +102,7 @@ push_config = {
'SMTP_PASSWORD': '', # SMTP 登录密码,也可能为特殊口令,视具体邮件服务商说明而定
'SMTP_NAME': '', # SMTP 收发件人姓名,可随意填写
'PUSHME_KEY': '', # PushMe 酱的 PUSHME_KEY
'CHRONOCAT_QQ': '', # qq号
'CHRONOCAT_TOKEN': '', # CHRONOCAT 的token
'CHRONOCAT_URL': '', # CHRONOCAT的url地址
'PUSHME_KEY': 'eQ5X030UxENFGVojO7tf', # PushMe 酱的 PUSHME_KEY
'WEBHOOK_URL': '', # 自定义通知 请求地址
'WEBHOOK_BODY': '', # 自定义通知 请求体
@ -839,12 +835,6 @@ if (
notify_function.append(smtp)
if push_config.get("PUSHME_KEY"):
notify_function.append(pushme)
if (
push_config.get("CHRONOCAT_URL")
and push_config.get("CHRONOCAT_QQ")
and push_config.get("CHRONOCAT_TOKEN")
):
notify_function.append(chronocat)
if push_config.get("WEBHOOK_URL") and push_config.get("WEBHOOK_METHOD"):
notify_function.append(custom_notify)
@ -875,7 +865,9 @@ def send(title: str, content: str) -> None:
def main():
send("title", "content")
# send("title", "content")
# pushme("再测试一下", "这个是在关闭后台时候推送的看看能收到吗122")
pushplus_bot("", "")
if __name__ == "__main__":