mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
Update jd_wish.js
This commit is contained in:
parent
3e627731df
commit
ac412b0697
68
jd_wish.js
68
jd_wish.js
@ -1,21 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
众筹许愿池
|
众筹许愿池
|
||||||
活动入口:京东-京东众筹-众筹许愿池
|
活动入口:京东-京东众筹-众筹许愿池
|
||||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
15 12,19 * * * jd_wish.js
|
||||||
===============Quantumultx===============
|
|
||||||
[task_local]
|
|
||||||
#众筹许愿池
|
|
||||||
40 0,2 * * * https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js, tag=众筹许愿池, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true
|
|
||||||
|
|
||||||
================Loon==============
|
|
||||||
[Script]
|
|
||||||
cron "40 0,2 * * *" script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js,tag=众筹许愿池
|
|
||||||
|
|
||||||
===============Surge=================
|
|
||||||
众筹许愿池 = type=cron,cronexp="40 0,2 * * *",wake-system=1,timeout=3600,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js
|
|
||||||
|
|
||||||
============小火箭=========
|
|
||||||
众筹许愿池 = type=cron,script-path=https://raw.githubusercontent.com/KingRan/JDJB/main/jd_wish.js, cronexpr="40 0,2 * * *", timeout=3600, enable=true
|
|
||||||
*/
|
*/
|
||||||
const $ = new Env('众筹许愿池');
|
const $ = new Env('众筹许愿池');
|
||||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
@ -26,7 +12,7 @@ let message = '', allMessage = '';
|
|||||||
let cookiesArr = [], cookie = '';
|
let cookiesArr = [], cookie = '';
|
||||||
const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
||||||
let appIdArr = ["1FVRZxKiD"];
|
let appIdArr = ["1FVRZxKiD"];
|
||||||
let appNameArr = ["超级大转盘"];
|
let appNameArr = ["超级转盘"];
|
||||||
let appId, appName;
|
let appId, appName;
|
||||||
$.shareCode = [];
|
$.shareCode = [];
|
||||||
if ($.isNode()) {
|
if ($.isNode()) {
|
||||||
@ -42,10 +28,6 @@ if ($.isNode()) {
|
|||||||
$.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"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(appIdArr.length <= 0) {
|
|
||||||
console.log(`\n暂无活动~\n`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (let i = 0; i < cookiesArr.length; i++) {
|
for (let i = 0; i < cookiesArr.length; i++) {
|
||||||
if (cookiesArr[i]) {
|
if (cookiesArr[i]) {
|
||||||
cookie = cookiesArr[i];
|
cookie = cookiesArr[i];
|
||||||
@ -54,7 +36,7 @@ if ($.isNode()) {
|
|||||||
$.isLogin = true;
|
$.isLogin = true;
|
||||||
$.nickName = '';
|
$.nickName = '';
|
||||||
message = '';
|
message = '';
|
||||||
//await TotalBean();
|
await TotalBean();
|
||||||
console.log(`\n*******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
console.log(`\n*******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||||
if (!$.isLogin) {
|
if (!$.isLogin) {
|
||||||
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
|
$.msg($.name, `【提示】cookie已失效`, `京东账号${$.index} ${$.nickName || $.UserName}\n请重新登录获取\nhttps://bean.m.jd.com/bean/signIndex.action`, {"open-url": "https://bean.m.jd.com/bean/signIndex.action"});
|
||||||
@ -64,7 +46,6 @@ if ($.isNode()) {
|
|||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let j = 0; j < appIdArr.length; j++) {
|
for (let j = 0; j < appIdArr.length; j++) {
|
||||||
appId = appIdArr[j]
|
appId = appIdArr[j]
|
||||||
appName = appNameArr[j]
|
appName = appNameArr[j]
|
||||||
@ -77,7 +58,12 @@ if ($.isNode()) {
|
|||||||
if ($.isNode()) await notify.sendNotify($.name, allMessage);
|
if ($.isNode()) await notify.sendNotify($.name, allMessage);
|
||||||
$.msg($.name, '', allMessage)
|
$.msg($.name, '', allMessage)
|
||||||
}
|
}
|
||||||
let res = await getAuthorShareCode('https://gitee.com/KingRan521/JD-Scripts/raw/master/shareCodes/wish.json')
|
let res = await getAuthorShareCode('https://cdn.jsdelivr.net/gh/6dylan6/updateTeam@main/shareCodes/wish.json')
|
||||||
|
if (!res) {
|
||||||
|
$.http.get({url: 'https://cdn.jsdelivr.net/gh/6dylan6/updateTeam@main/shareCodes/wish.json'}).then((resp) => {}).catch((e) => console.log('刷新CDN异常', e));
|
||||||
|
await $.wait(1000)
|
||||||
|
res = await getAuthorShareCode('https://cdn.jsdelivr.net/gh/6dylan6/updateTeam@main/shareCodes/wish.json')
|
||||||
|
}
|
||||||
$.shareCode = [...$.shareCode, ...(res || [])]
|
$.shareCode = [...$.shareCode, ...(res || [])]
|
||||||
for (let i = 0; i < cookiesArr.length; i++) {
|
for (let i = 0; i < cookiesArr.length; i++) {
|
||||||
if (cookiesArr[i]) {
|
if (cookiesArr[i]) {
|
||||||
@ -118,9 +104,7 @@ if ($.isNode()) {
|
|||||||
})
|
})
|
||||||
async function jd_wish() {
|
async function jd_wish() {
|
||||||
try {
|
try {
|
||||||
$.hasEnd = false;
|
|
||||||
await healthyDay_getHomeData();
|
await healthyDay_getHomeData();
|
||||||
if($.hasEnd) return;
|
|
||||||
await $.wait(2000)
|
await $.wait(2000)
|
||||||
|
|
||||||
let getHomeDataRes = (await healthyDay_getHomeData(false)).data.result.userInfo
|
let getHomeDataRes = (await healthyDay_getHomeData(false)).data.result.userInfo
|
||||||
@ -136,12 +120,9 @@ async function jd_wish() {
|
|||||||
$.canLottery = true
|
$.canLottery = true
|
||||||
for (let j = 0; j < forNum && $.canLottery; j++) {
|
for (let j = 0; j < forNum && $.canLottery; j++) {
|
||||||
await interact_template_getLotteryResult()
|
await interact_template_getLotteryResult()
|
||||||
if (j == 9 && $.canLottery) {
|
|
||||||
console.log('抽太多次了,下次再继续吧!');
|
|
||||||
break
|
|
||||||
}
|
|
||||||
await $.wait(2000)
|
await $.wait(2000)
|
||||||
}
|
}
|
||||||
|
if (message) allMessage += `京东账号${$.index} ${$.nickName || $.UserName}\n${appName}\n${message}${$.index !== cookiesArr.length ? '\n\n' : ''}`
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
$.logErr(e)
|
$.logErr(e)
|
||||||
@ -150,7 +131,6 @@ async function jd_wish() {
|
|||||||
|
|
||||||
async function healthyDay_getHomeData(type = true) {
|
async function healthyDay_getHomeData(type = true) {
|
||||||
return new Promise(async resolve => {
|
return new Promise(async resolve => {
|
||||||
// console.log(taskUrl('healthyDay_getHomeData', { "appId": appId, "taskToken": "", "channelId": 1 }));
|
|
||||||
$.post(taskUrl('healthyDay_getHomeData', { "appId": appId, "taskToken": "", "channelId": 1 }), async (err, resp, data) => {
|
$.post(taskUrl('healthyDay_getHomeData', { "appId": appId, "taskToken": "", "channelId": 1 }), async (err, resp, data) => {
|
||||||
try {
|
try {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -159,20 +139,18 @@ async function healthyDay_getHomeData(type = true) {
|
|||||||
} else {
|
} else {
|
||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
// console.log(data);
|
|
||||||
if(data.data.bizCode === 0) {
|
|
||||||
if (type) {
|
if (type) {
|
||||||
for (let key of Object.keys(data.data.result.hotTaskVos).reverse()) {
|
for (let key of Object.keys(data.data.result.hotTaskVos).reverse()) {
|
||||||
let vo = data.data.result.hotTaskVos[key]
|
let vo = data.data.result.hotTaskVos[key]
|
||||||
if (vo.status !== 2) {
|
if (vo.status !== 2) {
|
||||||
if (vo.taskType === 13 || vo.taskType === 12) {
|
if (vo.taskType === 13 || vo.taskType === 12) {
|
||||||
console.log(`点击热区`)
|
console.log(`点击热区`)
|
||||||
await harmony_collectScore({ "appId": appId, "taskToken": vo.simpleRecordInfoVo.taskToken, "taskId": vo.taskId, "actionType": "0" }, vo.taskType)
|
await harmony_collectScore({ "appId": appId, "taskToken": vo.simpleRecordInfoVo.taskToken, "taskId": vo.taskId, "actionType": "0" }, vo.taskType)
|
||||||
} else {
|
} else {
|
||||||
console.log(`【${vo.taskName}】已完成\n`)
|
console.log(`【${vo.taskName}】已完成\n`)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let key of Object.keys(data.data.result.taskVos).reverse()) {
|
for (let key of Object.keys(data.data.result.taskVos).reverse()) {
|
||||||
let vo = data.data.result.taskVos[key]
|
let vo = data.data.result.taskVos[key]
|
||||||
if (vo.status !== 2) {
|
if (vo.status !== 2) {
|
||||||
@ -203,8 +181,8 @@ async function healthyDay_getHomeData(type = true) {
|
|||||||
await harmony_collectScore({ "appId": appId, "taskToken": productInfoVos.taskToken, "taskId": vo.taskId, "actionType": "0" })
|
await harmony_collectScore({ "appId": appId, "taskToken": productInfoVos.taskToken, "taskId": vo.taskId, "actionType": "0" })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (vo.taskType === 3) {
|
} else if (vo.taskType === 3 && vo.shoppingActivityVos) {
|
||||||
for (let key of Object.keys(vo.shoppingActivityVos)) {
|
for (let key of Object.keys(vo.shoppingActivityVos)) {
|
||||||
let shoppingActivityVos = vo.shoppingActivityVos[key]
|
let shoppingActivityVos = vo.shoppingActivityVos[key]
|
||||||
if (shoppingActivityVos.status !== 2) {
|
if (shoppingActivityVos.status !== 2) {
|
||||||
console.log(`【${vo.subTitleName}】`)
|
console.log(`【${vo.subTitleName}】`)
|
||||||
@ -251,10 +229,6 @@ async function healthyDay_getHomeData(type = true) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
console.log(`黑号,火爆了\n`)
|
|
||||||
$.hasEnd = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user