forked from NaroisCool/naro-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path三国桃园.js
88 lines (76 loc) · 3.26 KB
/
三国桃园.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
/*
cron: 59 15 8 * * *
三国杀OL小程序-三国桃园刷任务
抓包找到自己的Authenticate填到sanguosha变量,多个账号用;隔开
*/
const notify = require('./sendNotify')
const axios = require('axios')
//每日签到
// 从环境变量中获取Cookie
const cookieHeaderValue = process.env.sanguosha;
// 将Cookie值拆分为单独的Cookie
const cookies = cookieHeaderValue.split(';');
function version(){
return new Promise(function(resolve,reject){
resolve(axios.get("https://gitee.com/naro_li/statement/raw/main/naro-scripts"))})
}
async function main(){
await version().then(data=>{console.log(data.data)})
let msgStr = ''
// 遍历每个Cookie值
for(cookie of cookies){
let header = {
"Host": "preolforum.sanguosha.com",
"Connection": "keep-alive",
"Authenticate": cookie,
"content-type": "application/json",
"Accept-Encoding": "gzip,compress,br,deflate",
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/8.0.41(0x18002930) NetType/WIFI Language/zh_CN",
"Referer": "https://servicewechat.com/wx88a45073e0660980/59/page-frame.html"
}
await axios.get('https://preolforum.sanguosha.com//wx/user/info',{headers:header} )
.then((res) => {msgStr +='账号:'+res.data.data.name+'...\n'})
.catch((error) => {
console.error(error)
})
axios.get('https://preolforum.sanguosha.com//wx/forum/clock?type=1',{headers:header} )
.then((res) => {msgStr += res.data.msg+'\n'})
.catch((error) => {
console.error(error.response.data)
})
axios.get('https://preolforum.sanguosha.com//v2/forum/list?fid=77&page=1',{headers:header} )
.then((res) => {
//console.log(res.data.data.list)
let count = 0;
for (const item of res.data.data.list) {
//console.log(item'isLike'])
if (item.isLike === false) {
//浏览帖子
axios.get('https://preolforum.sanguosha.com//wx/first/post?tid='+item.tid,{headers:header} )
.then((res) => {
msgStr +='浏览帖子任务'+res.data.msg+'\n'
}).catch((error) => {
console.error(cookie+error.response.data)
})
//点赞
axios.get('https://preolforum.sanguosha.com//wx/thread/like?tid='+item.tid,{headers:header} )
.then((res) => {
msgStr +='点赞任务'+res.data.msg+'\n'
}).catch((error) => {
console.error(cookie+error.response.data)
})
count = count+1
}
//每日五次
if (count >= 5) {
break;
}
}
})
.catch((error) => {
console.error(error.response.data)
})
}
notify.sendNotify('三国桃园',msgStr)
}
main()