From da1d006b1e0fede8b5a1851a45503f2ec3015e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=9D=E3=82=89?= Date: Mon, 9 May 2022 09:07:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0Bark=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 | 6 +++++- push.py | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/push.ini.example b/config/push.ini.example index c139ea4..39f51b3 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -28,4 +28,8 @@ token= [dingrobot] webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX -secret= \ No newline at end of file +secret= + +[bark] +api_url=https://api.day.app +token=ssXXX diff --git a/push.py b/push.py index ec4aca2..c492d23 100644 --- a/push.py +++ b/push.py @@ -128,6 +128,12 @@ def dingrobot(status, push_message): ).json() log.info(f"推送结果:{rep.get('errmsg')}") +# Bark +def bark(status, push_message): + http.get( + url=f'{cfg.get("bark", "api_url")}/{cfg.get("bark", "token")}/{title(status)}/{push_message}' + ) + def push(status, push_message): if not load_config(): return 0