mirror of
https://github.com/okyyds/yydspure.git
synced 2023-07-10 13:41:21 +08:00
1
This commit is contained in:
42
jd_wish.js
42
jd_wish.js
@@ -1,8 +1,22 @@
|
||||
/*
|
||||
众筹许愿池
|
||||
活动入口:京东-京东众筹-众筹许愿池
|
||||
40 0,2 * * * jd_wish.js
|
||||
*/
|
||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.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 notify = $.isNode() ? require('./sendNotify') : '';
|
||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||
@@ -11,8 +25,8 @@ let message = '', allMessage = '';
|
||||
//IOS等用户直接用NobyDa的jd cookie
|
||||
let cookiesArr = [], cookie = '';
|
||||
const JD_API_HOST = 'https://api.m.jd.com/client.action';
|
||||
let appIdArr = ['1FVRZxKiD'];
|
||||
let appNameArr = ['超级大转盘'];
|
||||
let appIdArr = ["1FVRZxKiD"];
|
||||
let appNameArr = ["超级大转盘"];
|
||||
let appId, appName;
|
||||
$.shareCode = [];
|
||||
if ($.isNode()) {
|
||||
@@ -28,6 +42,10 @@ 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"});
|
||||
return;
|
||||
}
|
||||
if(appIdArr.length <= 0) {
|
||||
console.log(`\n暂无活动~\n`);
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < cookiesArr.length; i++) {
|
||||
if (cookiesArr[i]) {
|
||||
cookie = cookiesArr[i];
|
||||
@@ -36,7 +54,7 @@ if ($.isNode()) {
|
||||
$.isLogin = true;
|
||||
$.nickName = '';
|
||||
message = '';
|
||||
await TotalBean();
|
||||
//await TotalBean();
|
||||
console.log(`\n*******开始【京东账号${$.index}】${$.nickName || $.UserName}*********\n`);
|
||||
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"});
|
||||
@@ -46,6 +64,7 @@ if ($.isNode()) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
for (let j = 0; j < appIdArr.length; j++) {
|
||||
appId = appIdArr[j]
|
||||
appName = appNameArr[j]
|
||||
@@ -99,7 +118,9 @@ if ($.isNode()) {
|
||||
})
|
||||
async function jd_wish() {
|
||||
try {
|
||||
$.hasEnd = false;
|
||||
await healthyDay_getHomeData();
|
||||
if($.hasEnd) return;
|
||||
await $.wait(2000)
|
||||
|
||||
let getHomeDataRes = (await healthyDay_getHomeData(false)).data.result.userInfo
|
||||
@@ -135,6 +156,7 @@ async function healthyDay_getHomeData(type = true) {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
// console.log(data);
|
||||
if(data.data.bizCode === 0) {
|
||||
if (type) {
|
||||
for (let key of Object.keys(data.data.result.hotTaskVos).reverse()) {
|
||||
let vo = data.data.result.hotTaskVos[key]
|
||||
@@ -145,8 +167,8 @@ async function healthyDay_getHomeData(type = true) {
|
||||
} else {
|
||||
console.log(`【${vo.taskName}】已完成\n`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (let key of Object.keys(data.data.result.taskVos).reverse()) {
|
||||
let vo = data.data.result.taskVos[key]
|
||||
if (vo.status !== 2) {
|
||||
@@ -178,7 +200,7 @@ async function healthyDay_getHomeData(type = true) {
|
||||
}
|
||||
}
|
||||
} else if (vo.taskType === 3) {
|
||||
for (let key of Object.keys(vo.shoppingActivityVos)) {
|
||||
for (let key of Object.keys(vo.shoppingActivityVos)) {
|
||||
let shoppingActivityVos = vo.shoppingActivityVos[key]
|
||||
if (shoppingActivityVos.status !== 2) {
|
||||
console.log(`【${vo.subTitleName}】`)
|
||||
@@ -225,6 +247,10 @@ async function healthyDay_getHomeData(type = true) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(`黑号,火爆了\n`)
|
||||
$.hasEnd = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user