forked from FENNY521/JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxiaoleziye.js
399 lines (225 loc) · 7.22 KB
/
xiaoleziye.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
/*ziye
微信扫码 https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.png 获取授权
开软件,然后进签到,点签到获取cookie
10.5 增加更多通知内容
10.7 修复cookie,获取问题
hostname=minapp.xqrobot.net,
#小乐
############## 圈x
https:\/\/minapp\.xqrobot\.net\/* url script-request-body https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.js
#小乐
############## loon
http-request https:\/\/minapp\.xqrobot\.net\/* script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.js, requires-body=true
#小乐
############## surge
小乐签到 = type=http-request,pattern=https:\/\/minapp\.xqrobot\.net\/*,script-path=https://raw.githubusercontent.com/ziye12/JavaScript/master/xiaoleziye.js, requires-body=true
*/
const sy = init()
const jsname='小乐签到'
const logs = 0; //0为关闭日志,1为开启
const notifyInterval=1//0为关闭通知,1为开启
const jbid=1;
const xiaoleurlKey = 'xiaoleurl'+jbid
const xiaoleheaderKey = 'xiaolehd'+jbid
const xiaolebodyKey = 'xiaolebd'+jbid
const xiaoleurlVal = sy.getdata(xiaoleurlKey)
const xiaoleheaderVal = sy.getdata(xiaoleheaderKey)
const xiaolebodyVal = sy.getdata(xiaolebodyKey)
var tz=''
let isGetCookie = typeof $request !== 'undefined'
if (isGetCookie) {
GetCookie()
} else {
all()
}
function GetCookie() {
if ($request.headers){
if($request &&$request.url.indexOf("/user.php?mod=sign&")>=0) {
const xiaoleurlVal = $request.url
if (xiaoleurlVal) sy.setdata(xiaoleurlVal,xiaoleurlKey)
sy.log(`[${jsname}] 获取url请求: 成功,xiaoleurlVal: ${xiaoleurlVal}`)
const xiaolebodyVal = $request.body
if (xiaolebodyVal) sy.setdata(xiaolebodyVal,xiaolebodyKey)
sy.log(`[${jsname}] 获取阅读: 成功,xiaolebodyVal: ${xiaolebodyVal}`)
const xiaoleheaderVal = JSON.stringify($request.headers)
if (xiaoleheaderVal) sy.setdata(xiaoleheaderVal,xiaoleheaderKey)
sy.log(`[${jsname}] 获取Cookie: 成功,xiaoleheaderVal: ${xiaoleheaderVal}`)
sy.msg(xiaoleheaderKey, `获取Cookie: 成功🎉`, ``)
}
}
}
function all()
{
for(var i=0;i<5;i++)
{ (function(i) {
setTimeout(function() {
if(i==0) xiaoletask(i);
else if(i==1) xiaoleuser(i);
else if(i==2) xiaoletg(i);
else if(i==3) xiaolesy(i);
else if(i==4) showmsg(i);
}, (i + 1) *1000);
})(i)
}}
//签到
function xiaoletask() {
return new Promise((resolve, reject) => {
const toxiaoleurl = {
url: xiaoleurlVal,
headers: JSON.parse(xiaoleheaderVal),
body: xiaolebodyVal
};
sy.post(toxiaoleurl,(error, response, data) =>{
if(logs) sy.log(`${jsname}, 签到信息: ${data}`)
signinfo =JSON.parse(data)
if (signinfo.result==true)
{
tz+='【签到成功】🎉:'+signinfo.show+'\n'
}
else if (signinfo.result==false)
{
tz+='【重复签到】✖️:'+signinfo.show+'\n'
}
resolve()
})
})
}
function xiaoleuser() {
return new Promise((resolve, reject) => {
const toxiaoleuserurl = {
url: xiaoleurlVal.replace(/mod=sign/g, `mod=index`),
headers: JSON.parse(xiaoleheaderVal),
};
sy.post(toxiaoleuserurl,(error, response, data) =>{
if(logs) sy.log(`${jsname}, 用户信息: ${data}`)
userinfo =JSON.parse(data)
if (userinfo.result==true)
{
tz+='【'+userinfo.info.userlevel_name+'】👤:'+userinfo.info.user_name+'\n'+
'【现金余额】🧧:'+userinfo.info.user_money+'元'+'\n'+
'【今日收益】🧧:'+userinfo.info.jiang_day1+'元'+'\n'+
'【本月收益】🧧:'+userinfo.info.jiang_month1+'元'+'\n'+
'【签到任务】⏰:'+userinfo.info.task_list[0].name+'\n'+
'【签到收益】⏰:'+userinfo.info.task_list[0].money+'\n'+
'【签到信息】⏰:'+userinfo.info.task_list[0].desc+'\n'+
'【邀请任务】👥:'+userinfo.info.task_list[1].name+'\n'+
'【邀请收益】👥:'+userinfo.info.task_list[1].money+'\n'+
'【邀请信息】👥:'+userinfo.info.task_list[1].desc+'\n'
}
else if (userinfo.result==false)
{
tz+=userinfo.show
}
resolve()
})
})
}
function xiaoletg() {
return new Promise((resolve, reject) => {
const toxiaoletgurl = {
url: xiaoleurlVal.replace(/mod=sign/g, `mod=tg&act=user&level=&page=1`),
headers: JSON.parse(xiaoleheaderVal),
};
sy.post(toxiaoletgurl,(error, response, data) =>{
if(logs) sy.log(`${jsname}, 用户信息: ${data}`)
tginfo =JSON.parse(data)
if (tginfo.result==true)
{
tz+='【好友信息】😄:'+tginfo.list[0].user_name+'\n'+
'【注册时间】🤖:'+tginfo.list[0].user_atime+'\n'+
'【好友等级】🎊:'+tginfo.list[0].userlevel_name+'\n'
}
else if (userinfo.result==false)
{
tz+='错误'
}
resolve()
})
})
}
function xiaolesy() {
return new Promise((resolve, reject) => {
const toxiaolesyurl = {
url: xiaoleurlVal.replace(/mod=sign/g, `mod=tbk_jiang&page=1`),
headers: JSON.parse(xiaoleheaderVal),
};
sy.post(toxiaolesyurl,(error, response, data) =>{
if(logs) sy.log(`${jsname}, 收益信息: ${data}`)
syinfo =JSON.parse(data)
var xx=syinfo.list[0].jiang_text
var tt=xx.substring(xx.indexOf("用户")+2,xx.indexOf("奖励"));
if (syinfo.result==true)
{
tz+=
'【收益信息】👤:'+tt+'\n'+
'【下单时间】🧧:'+syinfo.list[0].jiang_adate+'\n'+
'【预计收益】🧧:'+syinfo.list[0].jiang_money+'元'+'\n'
}
else if (userinfo.result==false)
{
tz+=userinfo.show
}
resolve()
})
})
}
function showmsg() {
console.log(tz)
if (notifyInterval==1)
sy.msg(jsname,'',tz)
}
function init() {
isSurge = () => {
return undefined !== this.$httpClient
}
isQuanX = () => {
return undefined !== this.$task
}
getdata = (key) => {
if (isSurge()) return $persistentStore.read(key)
if (isQuanX()) return $prefs.valueForKey(key)
}
setdata = (key, val) => {
if (isSurge()) return $persistentStore.write(key, val)
if (isQuanX()) return $prefs.setValueForKey(key, val)
}
msg = (title, subtitle = '', body = '') => {
if (isSurge()) $notification.post(title, subtitle, body)
if (isQuanX()) $notify(title, subtitle, body)
}
log = (msg) => {
console.log(`${msg}\n`)
}
get = (options, callback) => {
if (isQuanX()) {
if (typeof options == 'string') options = { url: options }
options['method'] = 'GET'
return $task.fetch(options).then(
(response) => {
response['status'] = response.statusCode
callback(null, response, response.body)
},
(reason) => callback(reason.error, null, null)
)
}
if (isSurge()) return $httpClient.get(options, callback)
}
post = (options, callback) => {
if (isQuanX()) {
if (typeof options == 'string') options = { url: options }
options['method'] = 'POST'
$task.fetch(options).then(
(response) => {
response['status'] = response.statusCode
callback(null, response, response.body)
},
(reason) => callback(reason.error, null, null)
)
}
if (isSurge()) $httpClient.post(options, callback)
}
done = (value = {}) => {
$done(value)
}
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
}