Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/chavyleung/scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chavyleung committed Aug 11, 2020
2 parents 478fab4 + eac2771 commit 14ef89a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 25 deletions.
6 changes: 5 additions & 1 deletion 10000/10000.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 25 additions & 16 deletions 10010/10010.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const KEY_loginlotteryurl = 'chavy_loginlotteryurl_10010'
const KEY_loginlotteryheader = 'chavy_loginlotteryheader_10010'
const KEY_findlotteryurl = 'chavy_findlotteryurl_10010'
const KEY_findlotteryheader = 'chavy_findlotteryheader_10010'
const chavygolottery = true

const signinfo = {}
let VAL_loginurl = chavy.getdata(KEY_loginurl)
Expand All @@ -18,20 +19,23 @@ let VAL_loginlotteryurl = chavy.getdata(KEY_loginlotteryurl)
let VAL_loginlotteryheader = chavy.getdata(KEY_loginlotteryheader)
let VAL_findlotteryurl = chavy.getdata(KEY_findlotteryurl)
let VAL_findlotteryheader = chavy.getdata(KEY_findlotteryheader)
let golottery = JSON.parse(chavy.getdata("chavy_golottery_10010")||chavygolottery)

;(sign = async () => {
chavy.log(`🔔 ${cookieName}`)
await loginapp()
await signapp()
/*if (VAL_loginlotteryurl && VAL_findlotteryurl) await loginlottery()
if (signinfo.encryptmobile) {
if (golottery == true) {
if (VAL_loginlotteryurl && VAL_findlotteryurl) await loginlottery()
if (signinfo.encryptmobile) {
await findlottery()
if (signinfo.findlottery && signinfo.findlottery.acFrequency && signinfo.findlottery.acFrequency.usableAcFreq) {
for (let i = 0; i < signinfo.findlottery.acFrequency.usableAcFreq; i++) {
await lottery()
}
}
}*/
}
}
await getinfo()
showmsg()
chavy.done()
Expand Down Expand Up @@ -143,9 +147,10 @@ function gettel() {
return tel
}


function getinfo() {
return new Promise((resolve, reject) => {
const url = { url: `https://mina.10010.com/wxapplet/bind/getIndexData/alipay/alipaymini?user_id=${gettel()}` }
const url = { url: `https://m.client.10010.com/mobileService/home/queryUserInfoSeven.htm?version=iphone_c@7.0403&desmobiel=${gettel()}&showType=3`, headers: {"Cookie": JSON.parse(VAL_loginheader)["Cookie"]}}
chavy.get(url, (error, response, data) => {
try {
signinfo.info = JSON.parse(data)
Expand All @@ -163,39 +168,43 @@ function getinfo() {
function showmsg() {
let subTitle = ''
let detail = ''

// 签到结果
if (signinfo.signapp.signinMedal == 0) {
if (signinfo.signapp.msg == 'ok!') {
subTitle = `签到: 成功`
detail = `积分: +${signinfo.signapp.prizeCount}, 成长值: +${signinfo.signapp.growthV}, 鲜花: +${signinfo.signapp.flowerCount}`
detail = `积分: +${signinfo.signapp.data.prizeCount}, 成长值: +${signinfo.signapp.data.growthV}, 鲜花: +${signinfo.signapp.data.flowerCount}`
} else if (signinfo.signapp.msg == '用户今日已签到!') {
subTitle = `签到: 重复`
} else {
subTitle = `签到: 失败`
chavy.log(`❌ ${cookieName} signapp - response: ${JSON.stringify(signinfo.signapp)}`)
}

if (signinfo.info.code == '0000') {
if (signinfo.info.code == 'Y') {
// 基本信息
detail = detail ? `${detail}\n` : ``
const free = signinfo.info.dataList[0]
const flow = signinfo.info.dataList[1]
const voice = signinfo.info.dataList[2]
detail = `话费: ${free.number}${free.unit}, 已用: ${flow.number}${flow.unit}, 剩余: ${voice.number}${voice.unit}`
const traffic = signinfo.info.data.dataList[0]
const flow = signinfo.info.data.dataList[1]
const voice = signinfo.info.data.dataList[2]
const credit = signinfo.info.data.dataList[3]
const back = signinfo.info.data.dataList[4]
const money = signinfo.info.data.dataList[5]
detail = `${traffic.remainTitle}: ${traffic.number}${traffic.unit}, ${flow.remainTitle}: ${flow.number}${flow.unit}, ${voice.remainTitle}: ${voice.number}${voice.unit}, ${credit.remainTitle}: ${credit.number}${credit.unit}, ${back.remainTitle}: ${back.number}${back.unit}, ${money.remainTitle}: ${money.number}${money.unit}`
} else {
chavy.log(`❌ ${cookieName} signapp - response: ${JSON.stringify(signinfo.info)}`)
}

/*if (signinfo.findlottery && signinfo.findlottery.acFrequency && signinfo.lotterylist) {

if (golottery == true) {
if (signinfo.findlottery && signinfo.findlottery.acFrequency && signinfo.lotterylist) {
subTitle += `; 抽奖: ${signinfo.findlottery.acFrequency.usableAcFreq}次`
detail += '\n查看详情\n'

for (let i = 0; i < signinfo.findlottery.acFrequency.usableAcFreq; i++) {
detail += `\n抽奖 (${i + 1}): ${signinfo.lotterylist[i].RspMsg}`
}
} else {
} else {
chavy.log(`❌ ${cookieName} signapp - response: ${JSON.stringify(signinfo.findlottery)}`)
}*/
}
}

chavy.msg(cookieName, subTitle, detail)
}
Expand Down
12 changes: 6 additions & 6 deletions 10010/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ hostname = act.10010.com, m.client.10010.com

[Script]
# 注意获取Cookie有两条脚本
http-request ^https:\/\/act.10010.com\/SigninApp\/signin\/querySigninActivity.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js
http-request ^https:\/\/act.10010.com\/SigninApp(.*?)\/signin\/daySign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js
http-request ^https:\/\/m.client.10010.com\/dailylottery\/static\/(textdl\/userLogin|active\/findActivityInfo) script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js
http-request ^https?:\/\/act.10010.com\/SigninApp\/signin\/querySigninActivity.htm script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js
http-request ^https?:\/\/act.10010.com\/SigninApp(.*?)\/signin\/daySign script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js
http-request ^https?:\/\/m.client.10010.com\/dailylottery\/static\/(textdl\/userLogin|active\/findActivityInfo) script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.cookie.js
cron "10 0 0 * * *" script-path=https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.js
```

Expand All @@ -32,9 +32,9 @@ hostname = act.10010.com, m.client.10010.com

[rewrite_local]
# 注意获取Cookie有两条脚本
^https:\/\/act.10010.com\/SigninApp\/signin\/querySigninActivity.htm url script-request-header 10010.cookie.js
^https:\/\/act.10010.com\/SigninApp(.*?)\/signin\/daySign url script-request-header 10010.cookie.js
^https:\/\/m.client.10010.com\/dailylottery\/static\/(textdl\/userLogin|active\/findActivityInfo) url script-request-header 10010.cookie.js
^https?:\/\/act.10010.com\/SigninApp\/signin\/querySigninActivity.htm url script-request-header 10010.cookie.js
^https?:\/\/act.10010.com\/SigninApp(.*?)\/signin\/daySign url script-request-header 10010.cookie.js
^https?:\/\/m.client.10010.com\/dailylottery\/static\/(textdl\/userLogin|active\/findActivityInfo) url script-request-header 10010.cookie.js

[task_local]
1 0 * * * 10010.js
Expand Down
3 changes: 2 additions & 1 deletion box/chavy.boxjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"id": "10010",
"name": "10010",
"keys": ["chavy_tokenurl_10010", "chavy_tokenheader_10010", "chavy_signurl_10010", "chavy_signheader_10010", "chavy_loginlotteryurl_10010", "chavy_loginlotteryheader_10010", "chavy_findlotteryurl_10010", "chavy_findlotteryheader_10010"],
"settings": [{ "id": "chavy_golottery_10010", "name": "天天抽奖", "val": true, "type": "boolean", "desc": "天天抽奖开关" }],
"author": "@chavyleung",
"repo": "https://github.com/chavyleung/scripts/tree/master/10010",
"script": "https://raw.githubusercontent.com/chavyleung/scripts/master/10010/10010.js",
Expand Down Expand Up @@ -333,4 +334,4 @@
"icons": ["https://raw.githubusercontent.com/Orz-3/mini/master/wps.png", "https://raw.githubusercontent.com/Orz-3/task/master/wps.png"]
}
]
}
}
2 changes: 1 addition & 1 deletion ximalaya/ximalaya.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function showmsg() {
if (signinfo.info.isTickedToday == false) {
if (signinfo.sign.data.status == 0) {
subTitle = '签到: 成功'
detail = `当前连签: ${signinfo.info.continuousDays}天, 积分: ${signinfo.acc.data.score}(+${signinfo.info.awardAmount})`
detail = `当前连签: ${signinfo.info.continuousDays + 1}天, 积分: ${signinfo.acc.data.score}(+${signinfo.info.awardAmount})`
} else {
subTitle = '签到: 失败'
detail = `说明: ${signinfo.sign.data.msg}`
Expand Down

0 comments on commit 14ef89a

Please sign in to comment.