From 65f2f640ad50dc69593740cc8a6178d60917f5a9 Mon Sep 17 00:00:00 2001 From: hinak0 Date: Sun, 25 Sep 2022 23:04:27 +0800 Subject: [PATCH 1/2] minor: update start.bash --- start.bash | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/start.bash b/start.bash index 96b0569..89f73dc 100755 --- a/start.bash +++ b/start.bash @@ -1,6 +1,14 @@ #!/bin/bash + +# 输出日志路径 +stdout_path=$(cd `dirname $0`;pwd)/stdout.log +# 1-1200秒随机延时 +# 随机值$RANDOM值为1~32767 +delay=$[$RANDOM%1200]; + # 进入脚本所在目录 cd $(cd `dirname $0`;pwd) -# 随机延时$RANDOM值为1~32767 -sleep $[$RANDOM%1200]; -python ./main.py; + +echo "$(date) $[$delay/60]分钟后开始执行" > $stdout_path; +sleep $delay; +python3 main.py >> $stdout_path; From 25f358d511d458789ac77f80a555ecc3b064ce0f Mon Sep 17 00:00:00 2001 From: Anye <1844960181@qq.com> Date: Thu, 13 Oct 2022 13:19:10 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A3=9E=E4=B9=A6?= =?UTF-8?q?=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/push.ini.example | 11 +++++++---- push.py | 11 +++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/push.ini.example b/config/push.ini.example index ffc8e7c..1cd7057 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -1,9 +1,9 @@ [setting] enable=true -#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot bark pushdeer gotify smtp(邮件推送) -push_server=cqhttp -#server酱 pushplus dingrobot 的推送token -push_token=123456 +# 共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot feishubot bark pushdeer gotify smtp(邮件推送) +push_server=pushplus +# server酱 pushplus dingrobot 的推送token +push_token=XXXXXX [cqhttp] #cqhttp的服务端地址 @@ -32,6 +32,9 @@ token= webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX secret= +[feishubot] +webhook=https://open.feishu.cn/open-apis/bot/v2/hook/XXX + [bark] api_url=https://api.day.app token=ssXXX diff --git a/push.py b/push.py index 93a5449..fcf2294 100644 --- a/push.py +++ b/push.py @@ -170,6 +170,17 @@ def dingrobot(send_title, push_message): ).json() log.info(f"推送结果:{rep.get('errmsg')}") +# 飞书机器人 +def feishubot(send_title, push_message): + api_url = cfg.get('feishubot', 'webhook') # https://open.feishu.cn/open-apis/bot/v2/hook/XXX + rep = http.post( + url=api_url, + headers={"Content-Type": "application/json; charset=utf-8"}, + json={ + "msg_type": "text", "content": {"text": send_title + "\r\n" + push_message} + } + ).json() + log.info(f"推送结果:{rep.get('msg')}") # Bark def bark(send_title, push_message):