城城领现金.互助填写环境变量 CITY_SHARECODES

This commit is contained in:
wisz2021
2021-05-24 09:19:49 +08:00
parent 075d889a74
commit 011f33647d
3 changed files with 14 additions and 12 deletions

View File

@ -15,7 +15,8 @@
#每日抽奖(活动时间2021-05-01至2021-05-31) #每日抽奖(活动时间2021-05-01至2021-05-31)
13 1,22,23 * * * node /scripts/jd_daily_lottery.js >> /scripts/logs/jd_daily_lottery.log 2>&1 13 1,22,23 * * * node /scripts/jd_daily_lottery.js >> /scripts/logs/jd_daily_lottery.log 2>&1
#城城领现金
33 * * * * node /scripts/jd_city.js >> /scripts/logs/jd_city.log 2>&1
##############长期活动############## ##############长期活动##############
# 签到 # 签到
7 0,17 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1 7 0,17 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1

View File

@ -51,6 +51,7 @@
| `JDSGMH_SHARECODES` | 闪购盲盒<br>互助码 | 非必须 | 10/ | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) | | `JDSGMH_SHARECODES` | 闪购盲盒<br>互助码 | 非必须 | 10/ | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| `JDCFD_SHARECODES` | 京喜财富岛<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) | | `JDCFD_SHARECODES` | 京喜财富岛<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| `JDHEALTH_SHARECODES` | 东东健康社区<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) | | `JDHEALTH_SHARECODES` | 东东健康社区<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
| `CITY_SHARECODES` | 城城领现金<br>互助码 | 非必须 | 未知/未知 | 填写规则和上面类似,或见下方[互助码的填写规则](#互助码的填写规则) |
##### 控制脚本功能环境变量 ##### 控制脚本功能环境变量

View File

@ -1,7 +1,7 @@
/* /*
城城领现金 城城领现金
活动时间2021-03-20到2021-03-24 活动时间2021-05-25到2021-06-03
更新时间2021-03-20 22:55 更新时间2021-05-24 09:55
脚本兼容: QuantumultX, Surge,Loon, JSBox, Node.js 脚本兼容: QuantumultX, Surge,Loon, JSBox, Node.js
=================================Quantumultx========================= =================================Quantumultx=========================
[task_local] [task_local]
@ -19,9 +19,9 @@ cron "0 0-23/1 * * *" script-path=https://gitee.com/lxk0301/jd_scripts/raw/maste
城城领现金 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_city.js, cronexpr="0 0-23/1 * * *", timeout=3600, enable=true 城城领现金 = type=cron,script-path=https://gitee.com/lxk0301/jd_scripts/raw/master/jd_city.js, cronexpr="0 0-23/1 * * *", timeout=3600, enable=true
*/ */
const $ = new Env('城城领现金'); const $ = new Env('城城领现金');
const notify = $.isNode() ? require('../sendNotify') : ''; const notify = $.isNode() ? require('./sendNotify') : '';
//Node.js用户请在jdCookie.js处填写京东ck; //Node.js用户请在jdCookie.js处填写京东ck;
const jdCookieNode = $.isNode() ? require('../jdCookie.js') : ''; const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
//自动抽奖 ,环境变量 JD_CITY_EXCHANGE //自动抽奖 ,环境变量 JD_CITY_EXCHANGE
let exchangeFlag = $.getdata('jdJxdExchange') || !!0;//是否开启自动抽奖,建议活动快结束开启,默认关闭 let exchangeFlag = $.getdata('jdJxdExchange') || !!0;//是否开启自动抽奖,建议活动快结束开启,默认关闭
//IOS等用户直接用NobyDa的jd cookie //IOS等用户直接用NobyDa的jd cookie
@ -36,7 +36,7 @@ if ($.isNode()) {
cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item); cookiesArr = [$.getdata('CookieJD'), $.getdata('CookieJD2'), ...jsonParse($.getdata('CookiesJD') || "[]").map(item => item.cookie)].filter(item => !!item);
} }
const JD_API_HOST = 'https://api.m.jd.com/client.action'; const JD_API_HOST = 'https://api.m.jd.com/client.action';
let inviteCodes = [] let inviteCodes = ['xBd-HlYMlLUzqSkuz0qzAzuayqOG3FfAIeOTGLowr29_KbnH2bV4EX4@RtGKzr_wSAn2eIKZRdRm07jvOMS2zVH-g8ri6aOIZPDcI8v7CA', 'xBd-HlYMlLUzqSkuz0qzAzuayqOG3FfAIeOTGLowr29_KbnH2bV4EX4@RtGKzr_wSAn2eIKZRdRm07jvOMS2zVH-g8ri6aOIZPDcI8v7CA']
!(async () => { !(async () => {
if (!cookiesArr[0]) { if (!cookiesArr[0]) {
$.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"}); $.msg($.name, '【提示】请先获取京东账号一cookie\n直接使用NobyDa的京东签到获取', 'https://bean.m.jd.com/bean/signIndex.action', {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
@ -122,7 +122,7 @@ function taskPostUrl(functionId,body) {
'Host': 'api.m.jd.com', 'Host': 'api.m.jd.com',
'Connection': 'keep-alive', 'Connection': 'keep-alive',
'Content-Type': 'application/x-www-form-urlencoded', 'Content-Type': 'application/x-www-form-urlencoded',
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('../USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"), "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
'Accept-Language': 'zh-cn', 'Accept-Language': 'zh-cn',
'Accept-Encoding': 'gzip, deflate, br', 'Accept-Encoding': 'gzip, deflate, br',
} }
@ -272,10 +272,10 @@ function shareCodesFormat() {
const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1); const tempIndex = $.index > inviteCodes.length ? (inviteCodes.length - 1) : ($.index - 1);
$.newShareCodes = inviteCodes[tempIndex].split('@'); $.newShareCodes = inviteCodes[tempIndex].split('@');
} }
const readShareCodeRes = await readShareCode(); // const readShareCodeRes = await readShareCode();
if (readShareCodeRes && readShareCodeRes.code === 200) { // if (readShareCodeRes && readShareCodeRes.code === 200) {
$.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])]; // $.newShareCodes = [...new Set([...$.newShareCodes, ...(readShareCodeRes.data || [])])];
} // }
console.log(`${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`) console.log(`${$.index}个京东账号将要助力的好友${JSON.stringify($.newShareCodes)}`)
resolve(); resolve();
}) })
@ -322,7 +322,7 @@ function TotalBean() {
"Connection": "keep-alive", "Connection": "keep-alive",
"Cookie": cookie, "Cookie": cookie,
"Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2", "Referer": "https://wqs.jd.com/my/jingdou/my.shtml?sceneval=2",
"User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('../USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1") "User-Agent": $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./USER_AGENTS').USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1")
} }
} }
$.post(options, (err, resp, data) => { $.post(options, (err, resp, data) => {