-
Notifications
You must be signed in to change notification settings - Fork 1
/
donate-step.js
43 lines (36 loc) · 1.38 KB
/
donate-step.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* @Author: whyour
* @Github: https://github.com/whyour
* @Date: 2020-11-23 11:30:44
* @LastEditors: whyour
* @LastEditTime: 2020-11-30 13:18:48
quanx:
[task_local]
0 18 * * * https://raw.githubusercontent.com/whyour/hundun/master/quanx/donate-step.js, tag=捐步数, enabled=true
loon:
[Script]
cron "0 18 * * *" script-path=https://raw.githubusercontent.com/whyour/hundun/master/quanx/donate-step.js, tag=捐步数
surge:
[Script]
捐步数 = type=cron,cronexp=0 18 * * *,timeout=60,script-path=https://raw.githubusercontent.com/whyour/hundun/master/quanx/donate-step.js,
*
**/
const $ = new compatibility();
const donate =
"alipays://platformapi/startapp?appId=10000009&url=/www/stepDonate.htm?chInfo=antsports&sourceName=antsports";
$.notify("支付宝", "", "捐步数啦", donate);
$done();
function compatibility() {
_isQuanX = typeof $task != "undefined";
_isLoon = typeof $loon != "undefined";
_isSurge = typeof $httpClient != "undefined" && !_isLoon;
this.read = (key) => {
if (_isQuanX) return $prefs.valueForKey(key);
if (_isLoon) return $persistentStore.read(key);
};
this.notify = (title, subtitle, message, url) => {
if (_isLoon) $notification.post(title, subtitle, message, url);
if (_isQuanX) $notify(title, subtitle, message, { "open-url": url });
if (_isSurge) $notification.post(title, subtitle, message, { url: url });
};
}