forked from faintout/myself-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pzxq.js
96 lines (87 loc) · 3.11 KB
/
pzxq.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
// cron: 16 7,18 * * *
// const $ = new Env("瓶子星球签到");
// 抓header 中的Authorization 多账号换行
// export pzxq="Authorization
// Authorization"
const {
getCurrDay,checkTime,Env,random
} = require('./utils.js')
const {sendNotify} = require('./sendNotify.js')
const $ = new Env("瓶子星球签到");
const axios = require('axios')
const userInfoList = $.getEnvKey('pzxq').split('\n')
if(!userInfoList.length||userInfoList[0]===''){
throw new Error('未找到ck')
}
console.log(`获取到${userInfoList.length}个ck`);
const baseUrl = 'https://exapi.jxbscbd.com'
const url = {
userCheckIn:'/gateway/pointsMall/task/userCheckIn',
getUserPoints:'/gateway/pointsMall/user/getUserPoints?userNumber=6645c779a794800029436ab8',
getUserInfo:'/gateway/pointsMall/user/getUserForQuestionnaire'
}
const headers = {
'Content-Type': 'application/json',
'Authorization': '',
'Host': 'exapi.jxbscbd.com',
'Referer': 'https://servicewechat.com/wx5d8100503eb3ecc3/776/page-frame.html',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36 MicroMessenger/7.0.20.1781(0x6700143B) NetType/WIFI MiniProgramEnv/Windows WindowsWechat/WMPF WindowsWechat(0x63090a13) XWEB/9115'
}
const api = {
userCheckIn: (token,data) => {
return axios({
url: baseUrl+url.userCheckIn,
method: 'post',
headers: {...headers, 'Authorization': token},
data: data,
})
},
getUserPoints: (token) => {
return axios({
url: baseUrl+url.getUserPoints,
method: 'get',
headers: {...headers, 'Authorization': token}
})
},
getUserInfo: (token) => {
return axios({
url: baseUrl+url.getUserInfo,
method: 'get',
headers: {...headers, 'Authorization': token}
})
},
}
const processTokens = async () => {
let index = 0
const randomTime = random(1, 300)
console.log('随机延迟:',randomTime + '秒');
await $.wait(randomTime*1000)
for (const token of userInfoList) {
try {
$.log('')
index++
const {data: {data: {id, userNumber, telephoneNumber}}} = await api.getUserInfo(token);
const checkInParams = {
userId: id,
userNumber,
telephoneNumber
};
$.log(`账号【${index}】 查询信息成功:${telephoneNumber}`, );
await $.wait(1500);
const {data: {msg}} = await api.userCheckIn(token, checkInParams);
$.log(`账号【${index}】 签到信息:${msg}`, );
await $.wait(1500);
const {data: {data: {accumulatePoints, availablePoints}}} = await api.getUserPoints(token);
$.log(`账号【${index}】 累计积分:${accumulatePoints}`, );
$.log(`账号【${index}】 可用积分:${availablePoints}`, );
$.log('');
await $.wait(3500);
} catch (error) {
$.logErr(error.toString());
}
}
$.log('')
await sendNotify('瓶子星球签到', $.logs.join('<br>'))
$.done()
};
processTokens()