Skip to content

Commit 3905b9b

Browse files
author
ziye12
authored
Add files via upload
微信扫描zqdkziye.png进入小程序
1 parent cd8dfce commit 3905b9b

File tree

1 file changed

+344
-0
lines changed

1 file changed

+344
-0
lines changed

zqdkziye.js

Lines changed: 344 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
/*ziye
2+
3+
微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/master/zqdkziye.png 进入小程序,登录获取授权
4+
5+
6+
7+
2020.9.9
8+
9+
10+
说明:以早起打卡为例的打卡模版,可以抓包然后替换以下内容来制作其他打卡脚本
11+
12+
13+
需要替换的内容如下,先替换长的,再替换短的,自己用电脑或者KODE软件替换,下载链接https://apps.apple.com/cn/app/koder-code-editor/id1447489375
14+
15+
16+
17+
ph0001.hezyq.com
18+
早起打卡
19+
cs = 20
20+
xj = 1
21+
zqdkurl
22+
i=597
23+
zqdk
24+
25+
手动替换
26+
ph0001\.hezyq\.com
27+
28+
使用说明:
29+
30+
一,微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/master/zqdkziye.png 进入小程序,登录获取授权
31+
32+
二,然后将hostname复制粘贴进配置文件
33+
34+
三,将重写复制到 rewrite_local 下,再进入程序获取ck,建议 放入新建配置片段,获取之后禁用即可
35+
36+
功能如下:
37+
1.每日打卡,设置了开关,完成任务不再打卡
38+
2.打卡币统计,
39+
3.现金统计,自动提现
40+
41+
42+
***建议设置每小时运行一次
43+
44+
45+
圈X
46+
47+
1、hostname= ph0001.hezyq.com,
48+
49+
50+
51+
//surge
52+
早起打卡 = type=http-request,pattern=^https:\/\/ph0001\.hezyq\.com\/*,requires-body=1,max-size=0,script-path= https://raw.githubusercontent.com/ziye12/JavaScript/master/zqdkziye.js
53+
54+
55+
56+
//圈x
57+
https:\/\/ph0001\.hezyq\.com\/* url script-request-header https://raw.githubusercontent.com/ziye12/JavaScript/master/zqdkziye.js
58+
59+
60+
//loon
61+
http-request ^https:\/\/ph0001\.hezyq\.com\/* script-path= https://raw.githubusercontent.com/ziye12/JavaScript/master/zqdkziye.js
62+
, requires-body=true, timeout=10, tag=早起打卡
63+
64+
65+
66+
67+
68+
69+
*/
70+
71+
72+
//正文
73+
74+
75+
const sy = init()//声明必须
76+
const notifyInterval = 1; //通知开为1,常关为0
77+
const logs = 0; // 日志开关
78+
const jsname = '早起打卡'
79+
const jbid =1
80+
const sb='失败,请获取ck'
81+
82+
const cs = 20;//小程序打卡次数
83+
const xj = 1;//提现标准
84+
var tz=''
85+
86+
const dkurlkey = 'zqdkurl'+jbid
87+
const dkurl = sy.getdata(dkurlkey)
88+
89+
90+
let isGetCookie = typeof $request !== 'undefined'
91+
if (isGetCookie) {
92+
GetCookie()
93+
} else {
94+
all()
95+
}
96+
97+
98+
99+
function GetCookie() {
100+
if ($request && $request.url.match(/i=597&/))
101+
if ($request && $request.url.match(/action=today&contr=index/))
102+
{
103+
const dkurl = $request.url
104+
sy.log(`dkurl:${dkurl}`)
105+
if (dkurl) sy.setdata(dkurl, dkurlkey)
106+
sy.msg(dkurlkey, `获取cookie: 成功🎉`, ``)
107+
}
108+
109+
}
110+
111+
112+
//异步运行
113+
114+
115+
function all()
116+
117+
{
118+
119+
for(var i=0;i<3;i++)
120+
{ (function(i) {
121+
setTimeout(function() {
122+
123+
if(i==0) dktj(i);
124+
else if(i==1) dkxj(i);
125+
else if(i==2) showmsg(i);
126+
}, (i + 1) * 1000);
127+
})(i)
128+
129+
130+
}}
131+
132+
133+
134+
135+
//统计
136+
137+
function dktj() {
138+
return new Promise((resolve, reject) => {
139+
140+
const Tjurl = {
141+
url: dkurl
142+
};
143+
sy.get(Tjurl,(error, response, data) =>{
144+
if(logs)sy.log(`${jsname}1统计 - data: ${data}`)
145+
obj = JSON.parse(data)
146+
if(obj.status == 1 && obj.info.today.clock < cs){tz+="[账户信息]🎉"+"\n"+
147+
"今日已打卡"+[Number(obj.info.today.clock) ]+"/"+cs+"次"+"余"+[Number(obj.info.today. currency)]+"币"+"\n"
148+
}else tz+="[打卡完成]"+"余"+[Number(obj.info.today. currency)]+"币"+"\n"
149+
150+
151+
152+
153+
154+
cstj1(obj.info.today.clock);
155+
156+
157+
158+
resolve()
159+
})
160+
})
161+
}
162+
163+
164+
//次数统计
165+
166+
167+
function cstj1(tjtj)
168+
{
169+
if (tjtj<cs)
170+
dkdk();
171+
172+
173+
}
174+
175+
176+
//现金
177+
178+
function dkxj() {
179+
return new Promise((resolve, reject) => {
180+
181+
const Xjurl = {
182+
url: dkurl.replace(/action=today&contr=index/g, `action=index&contr=my`)
183+
};
184+
sy.get(Xjurl,(error, response, data) =>{
185+
if(logs)sy.log(`${jsname}1现金 - data: ${data}`)
186+
obj = JSON.parse(data)
187+
if(obj.status == 1) {
188+
189+
190+
191+
192+
tz +="💵现金余额"+
193+
obj.info.member.money+"元"+"\n"
194+
195+
}
196+
197+
else tz +=sb+"\n";
198+
199+
200+
xjtj1(obj.info.member.money);
201+
202+
203+
204+
resolve()
205+
})
206+
})
207+
}
208+
209+
210+
211+
212+
//自动提现
213+
214+
function dktx() {
215+
return new Promise((resolve, reject) => {
216+
217+
const Txurl = {
218+
url: dkurl.replace(/action=today&contr=index/g, `action=withdrawals&contr=my&money=${xj}&payment_code=`)
219+
};
220+
sy.get(Txurl,(error, response, data) =>{
221+
if(logs)sy.log(`${jsname}1提现 - data: ${data}`)
222+
obj = JSON.parse(data)
223+
if(obj.status == 1) {
224+
225+
tz +='提现成功,成功提现'+xj+'元'+"\n"
226+
227+
}
228+
229+
if(obj.status == 2) {
230+
231+
tz +='提现失败,原因:'+obj.info+"\n"
232+
233+
}
234+
235+
236+
237+
238+
resolve()
239+
})
240+
})
241+
}
242+
243+
244+
245+
//现金统计
246+
247+
248+
function xjtj1(tjtj)
249+
{
250+
if (tjtj>=xj)
251+
dktx()
252+
253+
}
254+
255+
256+
257+
//打卡
258+
function dkdk() {
259+
return new Promise((resolve, reject) => {
260+
261+
const Dkurl = {
262+
url: dkurl.replace(/action=today&contr=index/g, `action=sign&contr=clock`)
263+
};
264+
sy.get(Dkurl,(error, response, data) =>{
265+
if(logs)sy.log(`${jsname}1打卡- data: ${data}`)
266+
obj = JSON.parse(data)
267+
268+
if (obj.status==1){
269+
tz+='[️打卡任务]:'+'打卡次数+1'+'\n'
270+
271+
}
272+
else tz +=obj.info+'\n'
273+
274+
275+
resolve()
276+
})
277+
})
278+
}
279+
280+
281+
function showmsg() {
282+
283+
console.log(tz)
284+
285+
if (notifyInterval==1)
286+
sy.msg(jsname,'',tz)
287+
}
288+
289+
290+
function init() {
291+
isSurge = () => {
292+
return undefined !== this.$httpClient
293+
}
294+
isQuanX = () => {
295+
return undefined !== this.$task
296+
}
297+
getdata = (key) => {
298+
if (isSurge()) return $persistentStore.read(key)
299+
if (isQuanX()) return $prefs.valueForKey(key)
300+
}
301+
setdata = (key, val) => {
302+
if (isSurge()) return $persistentStore.write(key, val)
303+
if (isQuanX()) return $prefs.setValueForKey(key, val)
304+
}
305+
msg = (title, subtitle = '', body = '') => {
306+
if (isSurge()) $notification.post(title, subtitle, body)
307+
if (isQuanX()) $notify(title, subtitle, body)
308+
}
309+
log = (msg) => {
310+
console.log(`${msg}\n`)
311+
}
312+
get = (options, callback) => {
313+
if (isQuanX()) {
314+
if (typeof options == 'string') options = { url: options }
315+
options['method'] = 'GET'
316+
return $task.fetch(options).then(
317+
(response) => {
318+
response['status'] = response.statusCode
319+
callback(null, response, response.body)
320+
},
321+
(reason) => callback(reason.error, null, null)
322+
)
323+
}
324+
if (isSurge()) return $httpClient.get(options, callback)
325+
}
326+
post = (options, callback) => {
327+
if (isQuanX()) {
328+
if (typeof options == 'string') options = { url: options }
329+
options['method'] = 'POST'
330+
$task.fetch(options).then(
331+
(response) => {
332+
response['status'] = response.statusCode
333+
callback(null, response, response.body)
334+
},
335+
(reason) => callback(reason.error, null, null)
336+
)
337+
}
338+
if (isSurge()) $httpClient.post(options, callback)
339+
}
340+
done = (value = {}) => {
341+
$done(value)
342+
}
343+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
344+
}

0 commit comments

Comments
 (0)