From 4194fbabf16993c5e629f0c2a6d3d680303ec61e Mon Sep 17 00:00:00 2001 From: TingHsi Date: Mon, 9 May 2022 14:33:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=AE=B0=E5=BD=95bark=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- push.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/push.py b/push.py index 3b544d6..25b831a 100644 --- a/push.py +++ b/push.py @@ -139,9 +139,10 @@ def dingrobot(status, push_message): # Bark def bark(status, push_message): - http.get( + rep = http.get( url=f'{cfg.get("bark", "api_url")}/{cfg.get("bark", "token")}/{title(status)}/{push_message}' - ) + ).json() + log.info(f"推送结果:{rep.get('message')}") def push(status, push_message): if not load_config(): From 57ae78e4dbd5139ab23a87468bd225356e6fec0a Mon Sep 17 00:00:00 2001 From: TingHsi Date: Mon, 9 May 2022 14:46:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=AE=8C=E5=96=84bark=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- config/README.md | 28 +++++++++++++++++++++++++++- config/push.ini.example | 2 +- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 2bffaaa..63059dd 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,5 @@ dmypy.json config/*.json # push配置 -config/push.ini \ No newline at end of file +config/push.ini +.DS_Store diff --git a/config/README.md b/config/README.md index 004aed4..87bb82c 100644 --- a/config/README.md +++ b/config/README.md @@ -102,7 +102,7 @@ # push.ini配置教程 -* push_server 可选范围 cqhttp ftqq(sever酱) pushplus telegram dingrobot +* push_server 可选范围 cqhttp ftqq(sever酱) pushplus telegram dingrobot bark ## Wecom @@ -150,3 +150,29 @@ webhook=https://oapi.dingtalk.com/robot/send?access_token=XXX secret= ``` + + +## bark + +一款开源的消息推送工具 https://github.com/Finb/Bark + +手机安装bark客户端获得托管在api.day.app的Token,也可以自己搭建私有服务端。 + +**api_url**一般不用改,自己搭建私有服务端的需要改掉 + +**token**填写**APP**内**URL**中的密钥,此选项必填 + +> `https://api.day.app/` `token部分` `/Title/NotificationContent` + +填写示例 + +```ini +[setting] +enable=true +push_server=bark + +[bark] +api_url=https://api.day.app +token=XXX +``` + diff --git a/config/push.ini.example b/config/push.ini.example index bae9d17..466eba4 100644 --- a/config/push.ini.example +++ b/config/push.ini.example @@ -1,6 +1,6 @@ [setting] enable=false -#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot +#共有 cqhttp ftqq(sever酱) pushplus telegram wecom dingrobot bark push_server=cqhttp #server酱 pushplus dingrobot 的推送token push_token=123456