mirror of
https://github.com/shufflewzc/faker2.git
synced 2025-04-23 02:48:44 +08:00
update
This commit is contained in:
parent
31857039aa
commit
85881f3266
18
jd_car_exc.js
Normal file
18
jd_car_exc.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
13
jd_twcyz.js
13
jd_twcyz.js
@ -113,7 +113,7 @@ async function main() {
|
||||
//}
|
||||
console.log(`\n可抽奖${$.drawtimes}次,开始...`);
|
||||
for (let i = 0; i < $.drawtimes; i++) {
|
||||
//console.log(`进行第${i + 1}抽奖:`);;
|
||||
console.log(`进行${i + 1}次抽奖:`);;
|
||||
await takeRequest('superBrandTaskLottery');//抽奖
|
||||
await $.wait(1000);
|
||||
if (!$.runFlag) break;
|
||||
@ -242,16 +242,23 @@ function dealReturn(type, data) {
|
||||
} else {
|
||||
console.log(JSON.stringify(data));
|
||||
}
|
||||
|
||||
break;
|
||||
case 'superBrandTaskLottery':
|
||||
if (data.code === '0' && data.data.bizCode !== 'TK000') {
|
||||
$.runFlag = false;
|
||||
console.log(`抽奖次数已用完`);
|
||||
console.log(`抽奖打到上限!`);
|
||||
} else if (data.code === '0' && data.data.bizCode == 'TK000') {
|
||||
if (data.data && data.data.result && data.data.result.rewardComponent && data.data.result.rewardComponent.beanList) {
|
||||
if (data?.data?.result?.rewardComponent?.beanList) {
|
||||
if (data.data.result.rewardComponent.beanList.length > 0) {
|
||||
console.log(`获得豆子:${data.data.result.rewardComponent.beanList[0].quantity}`)
|
||||
}
|
||||
} else if (data?.data?.result?.rewardComponent?.couponList) {
|
||||
$.log('获得优惠券');
|
||||
} else if (data?.data?.result?.rewardComponent?.realList) {
|
||||
$.log('可能抽中实物,到APP查看!');
|
||||
} else {
|
||||
$.log('空气');
|
||||
}
|
||||
} else {
|
||||
$.runFlag = false;
|
||||
|
12
jd_unFollow.js
Normal file
12
jd_unFollow.js
Normal file
File diff suppressed because one or more lines are too long
@ -21,7 +21,7 @@ const querystring = require('querystring');
|
||||
const exec = require('child_process').exec;
|
||||
const $ = new Env();
|
||||
const timeout = 15000; //超时时间(单位毫秒)
|
||||
console.log("加载sendNotify,当前版本: 20230314");
|
||||
console.log("加载sendNotify,当前版本: 20230415");
|
||||
// =======================================go-cqhttp通知设置区域===========================================
|
||||
//gobot_url 填写请求地址http://127.0.0.1/send_private_msg
|
||||
//gobot_token 填写在go-cqhttp文件设置的访问密钥
|
||||
@ -116,6 +116,13 @@ let WP_UIDS_ONE = "";
|
||||
let GOTIFY_URL = '';
|
||||
let GOTIFY_TOKEN = '';
|
||||
let GOTIFY_PRIORITY = 0;
|
||||
|
||||
// =======================================BncrBot通知设置区域==============================================
|
||||
//BncrHost 填写BncrHost地址,如https://192.168.31.192:9090
|
||||
//BncrToken 填写Bncr的消息应用Token
|
||||
let BncrHost = '';
|
||||
let BncrToken = '';
|
||||
|
||||
let PushErrorTime = 0;
|
||||
let strTitle = "";
|
||||
let ShowRemarkType = "1";
|
||||
@ -669,6 +676,12 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc
|
||||
if (process.env["GOTIFY_PRIORITY" + UseGroupNotify]) {
|
||||
GOTIFY_PRIORITY = process.env["GOTIFY_PRIORITY" + UseGroupNotify];
|
||||
}
|
||||
if (process.env["BncrHost" + UseGroupNotify]) {
|
||||
BncrHost = process.env["BncrHost" + UseGroupNotify];
|
||||
}
|
||||
if (process.env["BncrToken" + UseGroupNotify]) {
|
||||
BncrToken = process.env["BncrToken" + UseGroupNotify];
|
||||
}
|
||||
//检查是否在不使用Remark进行名称替换的名单
|
||||
const notifySkipRemarkList = process.env.NOTIFY_SKIP_NAMETYPELIST ? process.env.NOTIFY_SKIP_NAMETYPELIST.split('&') : [];
|
||||
const titleIndex3 = notifySkipRemarkList.findIndex((item) => item === strTitle);
|
||||
@ -841,6 +854,7 @@ async function sendNotify(text, desp, params = {}, author = '\n\n本通知 By cc
|
||||
iGotNotify(text, desp, params), //iGot
|
||||
gobotNotify(text, desp), //go-cqhttp
|
||||
gotifyNotify(text, desp), //gotify
|
||||
bncrNotify(text, desp), //bncr
|
||||
wxpusherNotify(text, desp) // wxpusher
|
||||
]);
|
||||
}
|
||||
@ -1113,6 +1127,43 @@ async function isLoginByX1a0He(cookie) {
|
||||
});
|
||||
}
|
||||
|
||||
function bncrNotify(text, desp) {
|
||||
return new Promise(resolve => {
|
||||
try {
|
||||
if (BncrHost && BncrToken) {
|
||||
const options = {
|
||||
url: `${BncrHost}/api/qinglongMessage`,
|
||||
body: `title=${encodeURIComponent(text)}&message=${encodeURIComponent(
|
||||
desp
|
||||
)}&token=${BncrToken}`,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
};
|
||||
$.post(options, (err, resp, data) => {
|
||||
if (err) {
|
||||
console.log('\nBncr发送通知调用API失败!!\n');
|
||||
console.log(err);
|
||||
} else {
|
||||
data = JSON.parse(data);
|
||||
if (data.code === 200) {
|
||||
console.log('\nBncr发送通知消息成功🎉\n');
|
||||
} else {
|
||||
console.log(`\nBncr发送通知调用API失败:${data.msg}\n`);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(`\nBncr发送通知调用API失败:`, e);
|
||||
} finally {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function gotifyNotify(text, desp) {
|
||||
return new Promise((resolve) => {
|
||||
if (GOTIFY_URL && GOTIFY_TOKEN) {
|
||||
|
Loading…
Reference in New Issue
Block a user