luci-app-jd-dailybonus: sync upstream (#8647)

Co-authored-by: jerrykuku <jerrykuku@qq.com>
This commit is contained in:
aakkll 2022-01-12 13:24:16 +08:00 committed by GitHub
parent d63edcce3b
commit 0497bf2ee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -54,6 +54,12 @@ o = s:option(Value, 'dd_token', translate('Dingding Bot Token'))
o.rmempty = true
o.description = translate('创建一个群机器人并获取API Token设置安全关键字为:京东')
-- pushplus
o = s:option(Value, 'pp_token', translate('pushplus Token'))
o.rmempty = true
o.description = translate('微信推送基于pushplus服务请自行登录 https://www.pushplus.plus/ 绑定并获取 Token。')
-- telegram
o = s:option(Value, 'tg_token', translate('Telegram Bot Token'))

View File

@ -6,8 +6,8 @@
# See /LICENSE for more information.
#
USE_PROCD=1
START=25
STOP=10
NAME=jd-dailybonus
CRON_FILE=/etc/crontabs/root

View File

@ -86,6 +86,13 @@ notify() {
uclient-fetch -q --post-file=/tmp/jd-djson.json "https://oapi.dingtalk.com/robot/send?access_token=${dtoken}"
fi
#pushplus
ptoken=$(uci_get_by_type global pp_token)
POST_URL="http://www.pushplus.plus/send"
if [ ! -z $ptoken ]; then
curl -s -d "{\"token\":\"$ptoken\",\"title\":\"$title\",\"content\":\"$desc\"}" -H 'Content-Type: application/json' $POST_URL
fi
#telegram
TG_BOT_TOKEN=$(uci_get_by_type global tg_token)
TG_USER_ID=$(uci_get_by_type global tg_userid)