Skip to content

Commit ff91079

Browse files
committed
更新[WPS]: 1.小程序打卡可以自动答题; 2.自动做满邀请 10 个用户任务 (次日打卡送 10 天会员). 感谢 @Wenmoux 提供的邀请人列表
1 parent e73d6ef commit ff91079

11 files changed

Lines changed: 291 additions & 260 deletions

‎Env.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ function Env(name) {
1111
this.msg = (title = this.name, subt = '', desc = '') => {
1212
if (this.isSurge()) $notification.post(title, subt, desc)
1313
if (this.isQuanX()) $notify(title, subt, desc)
14-
this.log('==============📣系统通知📣==============')
15-
if (title) this.log(title)
16-
if (subt) this.log(subt)
17-
if (desc) this.log(desc)
14+
const _logs = ['', '==============📣系统通知📣==============']
15+
if (title) _logs.push(title)
16+
if (subt) _logs.push(subt)
17+
if (desc) _logs.push(desc)
18+
console.log(_logs.join('\n'))
1819
}
1920
this.getdata = (key) => {
2021
if (this.isSurge()) return $persistentStore.read(key)

‎Env.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎QuantumultX_AppStore_Local_Cookie.conf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc
131131

132132
# WPS
133133
^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list url script-request-header chavyleung/wps/wps.cookie.js
134-
^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/sign_up url script-request-header chavyleung/wps/wps.cookie.js
134+
^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/clock_in url script-request-header chavyleung/wps/wps.cookie.js
135135

136136
#智行火车
137137
^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? url script-request-body chavyleung/zxhc/zxhc.cookie.js

‎QuantumultX_Local_Cookie.conf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ https:\/\/www.maomicd.com\/plugin.php\?id=k_misign:sign&operation=qiandao url sc
127127

128128
# WPS
129129
^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
130-
^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/sign_up url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
130+
^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/clock_in url script-request-header https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
131131

132132
#智行火车
133133
^https:\/\/m\.ctrip\.com/restapi/soa2/14593/json/attendanceDay? url script-request-body https://raw.githubusercontent.com/chavyleung/scripts/master/zxhc/zxhc.cookie.js

‎QuantumultX_Local_Task.conf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#网易考拉
8383
1 0 * * * chavyleung/wykl/wykl.js
8484
# WPS
85-
1 6 * * * chavyleung/wps/wps.js
85+
0 9 * * * chavyleung/wps/wps.js
8686
#智行火车
8787
1 0 * * * chavyleung/zxhc/zxhc.js
8888
# 苏宁易购

‎QuantumultX_Remote_Task.conf‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
# WPS
166166
# 打开 APP 我 > 签到 (右上角, 不用手动签到)
167167
# 打开 `我的WPS会员` 小程序 (手动签到)
168-
1 6 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js
168+
0 9 * * * https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js
169169

170170
#智行火车
171171
# 打开 APP 手动签到一次: 访问下右下角 `个人中心` > `签到`

‎surge.cookies.sgmodule‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Rewrite: BiliBili = type=http-request,pattern=^https:\/\/(www|live)\.bilibili\.c
1414
Rewrite: CSDN = type=http-request,pattern=^https:\/\/gw.csdn.net\/mini-app\/v2\/lucky_draw\/login\/sign_in\?,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/csdn/csdn.cookie.js
1515
Rewrite: CSDN = type=http-request,pattern=^https:\/\/passport.csdn.net\/v2\/api\/app\/login\/checkAndRefreshToken,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/csdn/csdn.cookie.js
1616
Rewrite: V2EX = type=http-request,pattern=^https:\/\/www\.v2ex\.com\/mission\/daily,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/v2ex.cookie.js
17-
Rewrite: WPS = type=http-request,pattern=^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/sign_up,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
17+
Rewrite: WPS = type=http-request,pattern=^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/clock_in,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
1818
Rewrite: WPS = type=http-request,pattern=^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
1919
Rewrite: 懂球帝 = type=http-request,pattern=^https:\/\/api\.dongqiudi\.com\/v2\/user\/is_login,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/dongqiudi/dongqiudi.cookie.js
2020
Rewrite: 电信营业厅 = type=http-request,pattern=^https:\/\/wapside.189.cn:9001\/api\/home\/sign,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10000/10000.cookie.js,requires-body=true

‎surge.tasks.sgmodule‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Tasks: AcFun = type=cron,cronexp=3 0 * * *,script-path=https://raw.githubusercon
1111
Tasks: ApkTw = type=cron,cronexp=0 8 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/apktw/apktw.js,wake-system=true
1212
Tasks: BiliBili = type=cron,cronexp=2 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/bilibili/bilibili.js,wake-system=true
1313
Tasks: V2EX = type=cron,cronexp=2 9 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/v2ex/v2ex.js,wake-system=true
14-
Tasks: WPS = type=cron,cronexp=7 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js,wake-system=true
14+
Tasks: WPS = type=cron,cronexp=0 9 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js,wake-system=true
1515
Tasks: 叮咚买菜 = type=cron,cronexp=7 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/mcdd/mcdd.js,wake-system=true
1616
Tasks: 加油广东 = type=cron,cronexp=1 7 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/gdoil/gdoil.js,wake-system=true
1717
Tasks: 人人视频 = type=cron,cronexp=10 0 * * *,script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/rrtv/rrtv.js,wake-system=true

‎wps/README.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
55
> 2020.3.15 增加小程序签到
66
7+
> 2020.6.10 1.小程序打卡可以自动答题; 2.自动做满邀请 10 个用户任务 (次日打卡送 10 天会员). 感谢 @Wenmoux 提供的邀请人列表
8+
> 注意 1: 获取 Cookie 的正则有变动, 但不用重取 Cookie
9+
> 注意 2: 把签到时间调整为 06:00 - 13:00 之间
10+
711
## 配置 (Surge)
812

913
```properties
@@ -12,7 +16,7 @@ hostname = zt.wps.cn
1216

1317
[Script]
1418
http-request ^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
15-
http-request ^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/sign_up script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
19+
http-request ^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/clock_in script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.cookie.js
1620
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/wps/wps.js
1721
```
1822

@@ -24,7 +28,7 @@ hostname = 110.43.90.61, zt.wps.cn
2428

2529
[rewrite_local]
2630
^https:\/\/zt.wps.cn\/2018\/docer_check_in\/api\/act_list url script-request-header wps.cookie.js
27-
^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/sign_up url script-request-header wps.cookie.js
31+
^https:\/\/zt.wps.cn\/2018\/clock_in\/api\/clock_in url script-request-header wps.cookie.js
2832

2933
[task_local]
3034
1 0 * * * wps.js

‎wps/wps.cookie.js‎

Lines changed: 27 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,29 @@
1-
const chavy = init()
2-
const cookieName = 'WPS'
3-
const KEY_signhomeurl = 'chavy_signhomeurl_wps'
4-
const KEY_signhomeheader = 'chavy_signhomeheader_wps'
5-
const KEY_signwxurl = 'chavy_signwxurl_wps'
6-
const KEY_signwxheader = 'chavy_signwxheader_wps'
1+
const $ = new Env('WPS')
72

8-
if ($request && $request.method != 'OPTIONS' && $request.url.match(/act_list/)) {
9-
const VAL_signhomeurl = $request.url
10-
const VAL_signhomeheader = JSON.stringify($request.headers)
11-
if (VAL_signhomeurl) chavy.setdata(VAL_signhomeurl, KEY_signhomeurl)
12-
if (VAL_signhomeheader) chavy.setdata(VAL_signhomeheader, KEY_signhomeheader)
13-
chavy.msg(cookieName, `获取Cookie: 成功 (APP)`, ``)
14-
} else if ($request && $request.method != 'OPTIONS' && $request.url.match(/sign_up/)) {
15-
const VAL_signwxurl = $request.url
16-
const VAL_signwxheader = JSON.stringify($request.headers)
17-
if (VAL_signwxurl) chavy.setdata(VAL_signwxurl, KEY_signwxurl)
18-
if (VAL_signwxheader) chavy.setdata(VAL_signwxheader, KEY_signwxheader)
19-
chavy.msg(cookieName, `获取Cookie: 成功 (小程序)`, ``)
20-
}
3+
!(async () => {
4+
$.log('', `🔔 ${$.name}, 获取会话: 开始!`, '')
5+
const VAL_url = $request.url
6+
const VAL_headers = JSON.stringify($request.headers)
7+
$.log('', `❌ ${$.name}`, `url: ${$request.url}`, `headers: ${JSON.stringify($request.headers)}`, '')
218

22-
function init() {
23-
isSurge = () => {
24-
return undefined === this.$httpClient ? false : true
25-
}
26-
isQuanX = () => {
27-
return undefined === this.$task ? false : true
28-
}
29-
getdata = (key) => {
30-
if (isSurge()) return $persistentStore.read(key)
31-
if (isQuanX()) return $prefs.valueForKey(key)
32-
}
33-
setdata = (key, val) => {
34-
if (isSurge()) return $persistentStore.write(key, val)
35-
if (isQuanX()) return $prefs.setValueForKey(key, val)
36-
}
37-
msg = (title, subtitle, body) => {
38-
if (isSurge()) $notification.post(title, subtitle, body)
39-
if (isQuanX()) $notify(title, subtitle, body)
40-
}
41-
log = (message) => console.log(message)
42-
get = (url, cb) => {
43-
if (isSurge()) {
44-
$httpClient.get(url, cb)
45-
}
46-
if (isQuanX()) {
47-
url.method = 'GET'
48-
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
49-
}
50-
}
51-
post = (url, cb) => {
52-
if (isSurge()) {
53-
$httpClient.post(url, cb)
54-
}
55-
if (isQuanX()) {
56-
url.method = 'POST'
57-
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
58-
}
59-
}
60-
done = (value = {}) => {
61-
$done(value)
62-
}
63-
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
64-
}
65-
chavy.done()
9+
if (VAL_url && VAL_headers && /act_list/.test(VAL_url)) {
10+
$.setdata(VAL_url, 'chavy_signhomeurl_wps')
11+
$.setdata(VAL_headers, 'chavy_signhomeheader_wps')
12+
$.subt = '获取会话: 成功 (签到)!'
13+
} else if (VAL_url && VAL_headers && /clock_in/.test(VAL_url)) {
14+
$.setdata(VAL_url, 'chavy_signwxurl_wps')
15+
$.setdata(VAL_headers, 'chavy_signwxheader_wps')
16+
$.subt = '获取会话: 成功 (打卡)!'
17+
}
18+
})()
19+
.catch((e) => {
20+
$.subt = '获取会话: 失败!'
21+
$.desc = `原因: ${e}`
22+
$.log(`❌ ${$.name}, 获取会话: 失败! 原因: ${e}!`)
23+
})
24+
.finally(() => {
25+
$.msg($.name, $.subt, $.desc), $.log('', `🔔 ${$.name}, 获取会话: 结束!`, ''), $.done()
26+
})
27+
28+
// prettier-ignore
29+
function Env(t){this.name=t,this.logs=[],this.isSurge=(()=>"undefined"!=typeof $httpClient),this.isQuanX=(()=>"undefined"!=typeof $task),this.log=((...t)=>{this.logs=[...this.logs,...t],t?console.log(t.join("\n")):console.log(this.logs.join("\n"))}),this.msg=((t=this.name,s="",i="")=>{this.isSurge()&&$notification.post(t,s,i),this.isQuanX()&&$notify(t,s,i);const e=["","==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="];t&&e.push(t),s&&e.push(s),i&&e.push(i),console.log(e.join("\n"))}),this.getdata=(t=>this.isSurge()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):void 0),this.setdata=((t,s)=>this.isSurge()?$persistentStore.write(t,s):this.isQuanX()?$prefs.setValueForKey(t,s):void 0),this.get=((t,s)=>this.send(t,"GET",s)),this.wait=((t,s=t)=>i=>setTimeout(()=>i(),Math.floor(Math.random()*(s-t+1)+t))),this.post=((t,s)=>this.send(t,"POST",s)),this.send=((t,s,i)=>{if(this.isSurge()){const e="POST"==s?$httpClient.post:$httpClient.get;e(t,(t,s,e)=>{s&&(s.body=e,s.statusCode=s.status),i(t,s,e)})}this.isQuanX()&&(t.method=s,$task.fetch(t).then(t=>{t.status=t.statusCode,i(null,t,t.body)},t=>i(t.error,t,t)))}),this.done=((t={})=>$done(t))}

0 commit comments

Comments
 (0)