Skip to content

Commit 2efe937

Browse files
author
Agentlewind
committed
add 百词斩领取铜板
1 parent 143bd2a commit 2efe937

2 files changed

Lines changed: 150 additions & 0 deletions

File tree

bcz/bcz.cookie.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
const cookieName = '百词斩领取铜板'
2+
const cookieKey = 'cookie_tb'
3+
const shareKey = `share_key`
4+
const senku = init()
5+
6+
if (this.$request && this.$request.headers) {
7+
const cookieVal = $request.headers['Cookie']
8+
const url = $request.url
9+
const index1 = url.indexOf('=')
10+
const index2 = url.indexOf('&')
11+
const shareVal = url.substring(index1+1,index2)
12+
if (cookieVal&&shareVal) {
13+
if (senku.setdata(cookieVal,cookieKey)&&senku.setdata(shareVal,shareKey)) {
14+
senku.msg(`${cookieName}`, '获取Cookie: 成功', '')
15+
senku.log(`[${cookieName}] 获取Cookie: 成功, cookie: ${cookieVal}`)
16+
}
17+
}
18+
}
19+
function init() {
20+
isSurge = () => {
21+
return undefined === this.$httpClient ? false : true
22+
}
23+
isQuanX = () => {
24+
return undefined === this.$task ? false : true
25+
}
26+
getdata = (key) => {
27+
if (isSurge()) return $persistentStore.read(key)
28+
if (isQuanX()) return $prefs.valueForKey(key)
29+
}
30+
setdata = (key, val) => {
31+
if (isSurge()) return $persistentStore.write(key, val)
32+
if (isQuanX()) return $prefs.setValueForKey(key, val)
33+
}
34+
msg = (title, subtitle, body) => {
35+
if (isSurge()) $notification.post(title, subtitle, body)
36+
if (isQuanX()) $notify(title, subtitle, body)
37+
}
38+
log = (message) => console.log(message)
39+
get = (url, cb) => {
40+
if (isSurge()) {
41+
$httpClient.get(url, cb)
42+
}
43+
if (isQuanX()) {
44+
url.method = 'GET'
45+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
46+
}
47+
}
48+
post = (url, cb) => {
49+
if (isSurge()) {
50+
$httpClient.post(url, cb)
51+
}
52+
if (isQuanX()) {
53+
url.method = 'POST'
54+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
55+
}
56+
}
57+
done = (value = {}) => {
58+
$done(value)
59+
}
60+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
61+
}
62+
senku.done()

bcz/bcz.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
const cookieName = '百词斩领取铜板'
2+
const cookieKey = 'cookie_tb'
3+
const shareKey = `share_key`
4+
const senku = init()
5+
const cookieVal = senku.getdata(cookieKey)
6+
const shareVal = senku.getdata(shareKey)
7+
8+
let signinfo = {} //signinfo 对象初始化
9+
senku.log()
10+
check()
11+
// ^https?://app\.xiaoyuan\.ccb\.com/channelManage/outbreak/addOutbreak Cookie: cookieVal
12+
function check(cb) {
13+
const url = { url: `https://group.baicizhan.com/group/apply_reward`, headers: { Cookie: cookieVal } }
14+
url.headers['Content-Type'] = `text/plain;charset=utf-8`
15+
url.headers['User-Agent'] = `Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 MicroMessenger/7.0.10(0x17000a21) NetType/4G Language/zh_CN`
16+
const key = {share_key:shareVal}
17+
url.body = JSON.stringify(key)
18+
senku.log(url.body)
19+
senku.post(url, (error, response, data) => {
20+
signinfo = JSON.parse(data)
21+
22+
senku.log(JSON.stringify(signinfo))
23+
24+
const title = `${cookieName}`
25+
let subTitle = ``
26+
let detail = ''
27+
if (signinfo.code == 1) {
28+
if (signinfo.data.is_new) {
29+
subTitle += `成功`
30+
detail = `获取铜板数${signinfo.data.reward[2]}`
31+
}
32+
else {
33+
subTitle += `失败(重复签到)`
34+
}
35+
}
36+
else {
37+
detail = `状态: ${signinfo.message}`
38+
subTitle += '失败'
39+
}
40+
senku.msg(title, subTitle, detail)
41+
senku.done()
42+
})
43+
}
44+
45+
46+
function init() {
47+
isSurge = () => {
48+
return undefined === this.$httpClient ? false : true
49+
}
50+
isQuanX = () => {
51+
return undefined === this.$task ? false : true
52+
}
53+
getdata = (key) => {
54+
if (isSurge()) return $persistentStore.read(key)
55+
if (isQuanX()) return $prefs.valueForKey(key)
56+
}
57+
setdata = (key, val) => {
58+
if (isSurge()) return $persistentStore.write(key, val)
59+
if (isQuanX()) return $prefs.setValueForKey(key, val)
60+
}
61+
msg = (title, subtitle, body) => {
62+
if (isSurge()) $notification.post(title, subtitle, body)
63+
if (isQuanX()) $notify(title, subtitle, body)
64+
}
65+
log = (message) => console.log(message)
66+
get = (url, cb) => {
67+
if (isSurge()) {
68+
$httpClient.get(url, cb)
69+
}
70+
if (isQuanX()) {
71+
url.method = 'GET'
72+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
73+
}
74+
}
75+
post = (url, cb) => {
76+
if (isSurge()) {
77+
$httpClient.post(url, cb)
78+
}
79+
if (isQuanX()) {
80+
url.method = 'POST'
81+
$task.fetch(url).then((resp) => cb(null, {}, resp.body))
82+
}
83+
}
84+
done = (value = {}) => {
85+
$done(value)
86+
}
87+
return { isSurge, isQuanX, msg, log, getdata, setdata, get, post, done }
88+
}

0 commit comments

Comments
 (0)