mirror of
https://github.com/okyyds/yyds.git
synced 2026-07-12 22:01:16 +08:00
1
This commit is contained in:
36
jd_wish.js
36
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 $ = new Env('众筹许愿池');
|
||||||
const notify = $.isNode() ? require('./sendNotify') : '';
|
const notify = $.isNode() ? require('./sendNotify') : '';
|
||||||
//Node.js用户请在jdCookie.js处填写京东ck;
|
//Node.js用户请在jdCookie.js处填写京东ck;
|
||||||
@@ -11,8 +25,8 @@ let message = '', allMessage = '';
|
|||||||
//IOS等用户直接用NobyDa的jd cookie
|
//IOS等用户直接用NobyDa的jd cookie
|
||||||
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()) {
|
||||||
@@ -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"});
|
$.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];
|
||||||
@@ -36,7 +54,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"});
|
||||||
@@ -46,6 +64,7 @@ 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]
|
||||||
@@ -99,7 +118,9 @@ 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
|
||||||
@@ -135,6 +156,7 @@ async function healthyDay_getHomeData(type = true) {
|
|||||||
if (safeGet(data)) {
|
if (safeGet(data)) {
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
// console.log(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]
|
||||||
@@ -225,6 +247,10 @@ async function healthyDay_getHomeData(type = true) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
console.log(`黑号,火爆了\n`)
|
||||||
|
$.hasEnd = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user