Skip to content

Commit 176c394

Browse files
author
ziye12
authored
Add files via upload
0 parents  commit 176c394

File tree

1 file changed

+332
-0
lines changed

1 file changed

+332
-0
lines changed

yydkziye.js

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

0 commit comments

Comments
 (0)