对于已过期活动的脚本,添加通知提醒

This commit is contained in:
lxk0301
2021-01-01 16:30:51 +08:00
parent a1f162f30e
commit a4509004e1
7 changed files with 46 additions and 24 deletions

View File

@ -91,7 +91,7 @@ http-response ^https:\/\/jdjoy\.jd\.com\/pet\/getPetTreasureBox|^https:\/\/draw\
http-response ^https:\/\/account\.huami\.com\/v2\/client\/login script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, requires-body=true, timeout=10, tag=小米运动获取Token
# 京东代属
cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属
# cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属
# 京东快递
cron "10 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, tag=京东快递签到
@ -107,18 +107,18 @@ cron "3 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_script
# 京东赚赚
cron "10 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚
# 京东秒杀红包雨
cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨
# cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨
#注销京东店铺会员卡
cron "23 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, tag=注销京东店铺会员卡
# 京东直播
cron "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播
# 京东看一看
cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看
# cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, tag=京东看一看
#直播红包雨
cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨
# cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨
# 金融打卡领年终奖
cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖
# cron "10 6 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=金融打卡领年终奖
# 健康抽奖机
cron "10 0 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机
# 疯狂的joy日常任务

View File

@ -53,8 +53,6 @@ cron "40 * * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scrip
cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js, timeout=650, wake-system=1, tag=东东小窝
#十元街
cron "40 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js, timeout=650, wake-system=1, tag=十元街
#京东代属(仅京东学生认证用户可用)
cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, timeout=650, wake-system=1, tag=京东代属
#领京豆额外奖励
cron "30 10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, timeout=750, wake-system=1, tag=领京豆额外奖励
#京东汽车
@ -74,12 +72,6 @@ cron "20 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scri
#疯狂的joy日常任务
cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js, timeout=1750, wake-system=1, tag=疯狂的joy日常任务
#以下为短期活动
#金融打卡领年终奖
cron "30 7 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖
#健康抽奖机
cron "30 2 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机
#直播红包雨(2020-12-31活动结束)
cron "1 0,20,9-23/2 15-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, timeout=750, wake-system=1, tag=直播红包雨
#秒杀红包雨(2020-12-31活动结束)
cron "20 9 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, timeout=750, wake-system=1, tag=秒杀红包雨

View File

@ -60,7 +60,7 @@
# 十元街
36 8,18 * * * node /scripts/jd_syj.js >> /scripts/logs/jd_syj.log 2>&1
# 京东代属(注:限校园用户可使用)
36 9 * * * node /scripts/jd_ds.js >> /scripts/logs/jd_ds.log 2>&1
# 36 9 * * * node /scripts/jd_ds.js >> /scripts/logs/jd_ds.log 2>&1
# 京东快递签到
23 1 * * * node /scripts/jd_kd.js >> /scripts/logs/jd_kd.log 2>&1
# 京东汽车(签到满500赛点可兑换500京豆)

View File

@ -87,8 +87,15 @@ const JD_API_HOST = 'https://api.m.jd.com/';
})
function showMsg() {
return new Promise(resolve => {
$.msg($.name, '', `【京东账号${$.index}${$.nickName}\n${message}`);
return new Promise(async resolve => {
// $.msg($.name, '', `【京东账号${$.index}】${$.nickName}\n${message}`);
let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) {
$.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"});
if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`)
} else {
$.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`);
}
resolve()
})
}

View File

@ -83,8 +83,14 @@ const JD_API_HOST = 'https://api.m.jd.com/api';
})
function showMsg() {
return new Promise(resolve => {
$.msg($.name, '', `【京东账号${$.index}${$.nickName}\n${message}`);
return new Promise(async resolve => {
let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) {
$.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"});
if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`)
} else {
$.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`);
}
resolve()
})
}

View File

@ -188,6 +188,7 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
continue
}
await jdHealth()
await showMsg();
}
}
})()
@ -200,8 +201,8 @@ const JD_API_HOST = 'https://api.m.jd.com/client.action';
async function jdHealth() {
$.bean = 0
await getTaskList()
console.log(`${$.name}浏览次数:${$.task.times}/${$.task.maxTimes}`)
if($.task) {
console.log(`${$.name}浏览次数:${$.task.times}/${$.task.maxTimes}`)
let i = 0, j = $.task.times
while(j < $.task.maxTimes) {
if (!acceptBody[i]) break
@ -220,8 +221,15 @@ async function jdHealth() {
}
function showMsg() {
return new Promise(resolve => {
return new Promise(async resolve => {
// $.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`);
let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) {
$.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"});
if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`)
} else {
$.msg($.name, '', `京东账号${$.index} ${$.nickName}\n${message}`);
}
resolve()
})
}
@ -237,9 +245,11 @@ function getTaskList() {
} else {
if (safeGet(data)) {
data = JSON.parse(data);
if (data.busiCode === '0') {
$.task = data['data']['discTasks'][1]
}
}
}
} catch (e) {
$.logErr(e, resp)
} finally {

View File

@ -78,8 +78,14 @@ const JD_API_HOST = 'https://api.m.jd.com/api';
})
function showMsg() {
return new Promise(resolve => {
return new Promise(async resolve => {
let nowTime = new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000;
if (nowTime > new Date('2020/12/31 23:59:59+08:00').getTime()) {
$.msg($.name, '活动已结束', `咱江湖再见\nhttps://github.com/lxk0301/jd_scripts`, {"open-url": "https://github.com/lxk0301/jd_scripts"});
if ($.isNode()) await notify.sendNotify($.name + '活动已结束', `咱江湖再见\n https://github.com/lxk0301/jd_scripts`)
} else {
$.msg($.name, '', `【京东账号${$.index}${$.nickName}\n${message}`);
}
resolve()
})
}
@ -96,6 +102,7 @@ function sign() {
if (safeGet(data)) {
data = JSON.parse(data);
console.log(data.resultData.message)
message += `${data.resultData.message}`
}
}
} catch (e) {