This commit is contained in:
Faker 2023-03-10 10:12:17 +08:00
parent b75f2b4be2
commit 5063122644
2 changed files with 24 additions and 22 deletions

View File

@ -1,8 +1,7 @@
/*
众筹许愿池
40 5,8 * * * jd_wish.js
活动入口京东-京东众筹-众筹许愿池
15 12,19 * * * jd_wish.js
*/
const $ = new Env('众筹许愿池');
const notify = $.isNode() ? require('./sendNotify') : '';
@ -12,8 +11,8 @@ let message = '', allMessage = '';
//IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '';
const JD_API_HOST = 'https://api.m.jd.com/client.action';
let appIdArr = ["1EFVXyw"];
let appNameArr = ["年终奖补贴"];
let appIdArr = ["1FFVWyqyD"];
let appNameArr = ["踏海寻村"];
let appId, appName;
$.shareCode = [];
if ($.isNode()) {
@ -41,7 +40,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"});
@ -51,7 +50,6 @@ if ($.isNode()) {
}
continue
}
for (let j = 0; j < appIdArr.length; j++) {
appId = appIdArr[j]
appName = appNameArr[j]
@ -65,7 +63,12 @@ if ($.isNode()) {
if ($.isNode()) await notify.sendNotify($.name, allMessage);
$.msg($.name, '', allMessage)
}
let res = await getAuthorShareCode('')
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 || [])]
for (let i = 0; i < cookiesArr.length; i++) {
if (cookiesArr[i]) {
@ -128,8 +131,9 @@ async function jd_wish() {
console.log('抽太多次了,下次再继续吧!');
break
}
await $.wait(3000)
await $.wait(2000)
}
if (message) allMessage += `京东账号${$.index} ${$.nickName || $.UserName}\n${appName}\n${message}${$.index !== cookiesArr.length ? '\n\n' : ''}`
} catch (e) {
$.logErr(e)
@ -138,7 +142,6 @@ async function jd_wish() {
async function healthyDay_getHomeData(type = true) {
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) => {
try {
if (err) {
@ -156,7 +159,7 @@ async function healthyDay_getHomeData(type = true) {
if (vo.taskType === 13 || vo.taskType === 12) {
console.log(`点击热区`)
await harmony_collectScore({ "appId": appId, "taskToken": vo.simpleRecordInfoVo.taskToken, "taskId": vo.taskId, "actionType": "0" }, vo.taskType)
await $.wait(1500)
await $.wait(1000)
} else {
console.log(`${vo.taskName}】已完成\n`)
}
@ -168,14 +171,14 @@ async function healthyDay_getHomeData(type = true) {
if (vo.taskType === 13 || vo.taskType === 12) {
console.log(`签到`)
await harmony_collectScore({ "appId": appId, "taskToken": vo.simpleRecordInfoVo.taskToken, "taskId": vo.taskId, "actionType": "0" }, vo.taskType)
await $.wait(1500)
await $.wait(1000)
} else if (vo.taskType === 1) {
for (let key of Object.keys(vo.followShopVo)) {
let followShopVo = vo.followShopVo[key]
if (followShopVo.status !== 2) {
console.log(`${followShopVo.shopName}${vo.subTitleName}`)
await harmony_collectScore({ "appId": appId, "taskToken": followShopVo.taskToken, "taskId": vo.taskId, "actionType": "0" })
await $.wait(1500)
await $.wait(1000)
}
}
} else if (vo.taskType === 5) {
@ -184,7 +187,7 @@ async function healthyDay_getHomeData(type = true) {
if (browseShopVo.status !== 2) {
console.log(`${browseShopVo.skuName}${vo.subTitleName}`)
await harmony_collectScore({ "appId": appId, "taskToken": browseShopVo.taskToken, "taskId": vo.taskId, "actionType": "0" })
await $.wait(1500)
await $.wait(1000)
}
}
} else if (vo.taskType === 15) {
@ -193,7 +196,7 @@ async function healthyDay_getHomeData(type = true) {
if (productInfoVos.status !== 2) {
console.log(`${productInfoVos.skuName}${vo.subTitleName}`)
await harmony_collectScore({ "appId": appId, "taskToken": productInfoVos.taskToken, "taskId": vo.taskId, "actionType": "0" })
await $.wait(1500)
await $.wait(1000)
}
}
} else if (vo.taskType === 3) {
@ -202,7 +205,7 @@ async function healthyDay_getHomeData(type = true) {
if (shoppingActivityVos.status !== 2) {
console.log(`${vo.subTitleName}`)
await harmony_collectScore({ "appId": appId, "taskToken": shoppingActivityVos.taskToken, "taskId": vo.taskId, "actionType": "0" })
await $.wait(1500)
await $.wait(1000)
}
}
} else if (vo.taskType === 8) {
@ -213,7 +216,7 @@ async function healthyDay_getHomeData(type = true) {
await harmony_collectScore({ "appId": appId, "taskToken": productInfoVos.taskToken, "taskId": vo.taskId, "actionType": "1" })
await $.wait(vo.waitDuration * 1000)
await harmony_collectScore({ "appId": appId, "taskToken": productInfoVos.taskToken, "taskId": vo.taskId, "actionType": "0" })
await $.wait(1500)
await $.wait(1000)
}
}
} else if (vo.taskType === 27 && vo.taskId === 18) {
@ -229,7 +232,7 @@ async function healthyDay_getHomeData(type = true) {
await $.wait(vo.waitDuration * 1000)
}
await harmony_collectScore({ "appId": appId, "taskToken": shoppingActivityVos.taskToken, "taskId": vo.taskId, "actionType": "0" })
await $.wait(1500)
await $.wait(1000)
}
}
} else if (vo.taskType === 14) {

View File

@ -21,7 +21,7 @@ const querystring = require('querystring');
const exec = require('child_process').exec;
const $ = new Env();
const timeout = 15000; //超时时间(单位毫秒)
console.log("加载sendNotify当前版本: 20230224");
console.log("加载sendNotify当前版本: 20230309");
// =======================================go-cqhttp通知设置区域===========================================
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
//gobot_token 填写在go-cqhttp文件设置的访问密钥
@ -1283,8 +1283,7 @@ function tgBotNotify(text, desp) {
json: {
chat_id: `${TG_USER_ID}`,
text: `${text}\n\n${desp}`,
disable_web_page_preview:true,
parse_mode:"html",
disable_web_page_preview:true
},
headers: {
'Content-Type': 'application/json',