diff --git a/src/main/resources/test_bean.js b/src/main/resources/test_bean.js index f25ab34..e364a5b 100644 --- a/src/main/resources/test_bean.js +++ b/src/main/resources/test_bean.js @@ -30,8 +30,8 @@ let postTime = 11 let postDay = 1 let cookiesArr = [], cookie = '', jdPlantBeanShareArr = [], isBox = false, notify, newShareCodes, option, subTitle; let message = "" -let dingtalk1 = "https://oapi.dingtalk.com/robot/send?access_token=18444b555747aad3381bc1d1e3dea72b03158e152a846f818d82a1ca946bd430" -let dingtalk2 = "https://oapi.dingtalk.com/robot/send?access_token=04ab95f07aa0397e7167c6ea3a331bc7fcddbc4cda4a482b1e7e76755f97f6a0" +let dingtalk = "https://oapi.dingtalk.com/robot/send?access_token=18444b555747aad3381bc1d1e3dea72b03158e152a846f818d82a1ca946bd430" +let dingtalk1 = "https://oapi.dingtalk.com/robot/send?access_token=04ab95f07aa0397e7167c6ea3a331bc7fcddbc4cda4a482b1e7e76755f97f6a0" let roleMap = { "jd_4521b375ebb5d": "锟子怪", "jd_542c10c0222bc": "康子怪", @@ -110,10 +110,10 @@ let num; $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') }).finally(() => { that.log(message) - postToDingTalk(message,dingtalk1) + postToDingTalk(message) date = new Date() if (date.getDay() == postDay && date.getHours() == postTime) { - postToDingTalk(message,dingtalk2) + postToDingTalk1(message) } $.done(); @@ -794,7 +794,7 @@ function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env //我加的函数 -function postToDingTalk(messgae,dingtalk) { +function postToDingTalk(messgae) { const message1 = "" + messgae that.log(messgae) @@ -831,6 +831,43 @@ function postToDingTalk(messgae,dingtalk) { }, "json") } +function postToDingTalk1(messgae) { + const message1 = "" + messgae + that.log(messgae) + + const body = { + "msgtype": "markdown", + "markdown": { + "title": "种豆得豆", + "text": message1 + }, + "at": { + "atMobiles": [], + "isAtAll": false + } + } + + + $.post(toDingtalk(dingtalk1 , JSON.stringify(body)), (data, status, xhr) => { + try { + that.log(resp) + that.log(data) + if (err) { + that.log(JSON.stringify(err)); + $.logErr(err); + } else { + if (safeGet(data)) { + $.duckRes = JSON.parse(data); + } + } + } catch (e) { + $.logErr(e, resp) + } finally { + resolve(); + } + }, "json") +} + function toDingtalk(urlmain, bodyMain) { return { diff --git a/src/main/resources/test_fruit.js b/src/main/resources/test_fruit.js index d15f11b..57a5bdd 100644 --- a/src/main/resources/test_fruit.js +++ b/src/main/resources/test_fruit.js @@ -14,12 +14,17 @@ =========================Loon============================= [Script] cron "5 6-18/6 * * *" script-path=jd_fruit.js,tag=东东农场 + =========================Surge============================ 东东农场 = type=cron,cronexp="5 6-18/6 * * *",wake-system=1,timeout=3600,script-path=jd_fruit.js + =========================小火箭=========================== 东东农场 = type=cron,script-path=jd_fruit.js, cronexpr="5 6-18/6 * * *", timeout=3600, enable=true + jd免费水果 搬的https://github.com/liuxiaoyucc/jd-helper/blob/a6f275d9785748014fc6cca821e58427162e9336/fruit/fruit.js + export DO_TEN_WATER_AGAIN="" 默认再次浇水 + */ const $ = new Env('东东农场'); let cookiesArr = [], cookie = '', jdFruitShareArr = [], isBox = false, notify, newShareCodes, allMessage = ''; @@ -43,6 +48,7 @@ let roleMap = { "jd_66ea783827d30": "军子", "jd_4311ac0ff4456": "居子" } + //目前改成先号内互助 有多余次数互助池子 let message = '', subTitle = '', option = {}, isFruitFinished = false; const retainWater = 100;//保留水滴大于多少g,默认100g; @@ -66,6 +72,7 @@ const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%2 $.isLogin = true; $.nickName = ''; await TotalBean(); + username = $.UserName if (roleMap[username] != undefined) { username = roleMap[username] @@ -74,6 +81,7 @@ const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%2 //加上名称 message = message + "【羊毛姐妹】" + username + " \n\n " + 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" }); @@ -88,6 +96,7 @@ const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%2 //await shareCodesFormat(); await jdFruit(); } + message += "----\n\n" that.log(message) } @@ -120,13 +129,10 @@ const urlSchema = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%2 $.log('', `❌ ${$.name}, 失败! 原因: ${e}!`, '') }) .finally(() => { - that.log(message) - postToDingTalk(message) $.done(); + postToDingTalk(message) }) - - async function jdFruit() { subTitle = `【京东账号${$.index}】${$.nickName || $.UserName}`; try { @@ -155,9 +161,9 @@ async function jdFruit() { //已下单购买, 但未开始种植新的水果 option['open-url'] = urlSchema; $.msg($.name, ``, `【京东账号${$.index}】 ${$.nickName || $.UserName}\n【提醒⏰】您忘了种植新的水果\n请去京东APP或微信小程序选购并种植新的水果\n点击弹窗即达`, option); + mes = " " + getManName + ",你好\n\n【提醒⏰】您忘了种植新的水果\n请去京东APP或微信小程序选购并种植新的水果" + postToDingTalk2(mes) if ($.isNode()) { - mes = " " + getManName + ",你好\n\n【提醒⏰】您忘了种植新的水果\n请去京东APP或微信小程序选购并种植新的水果" - postToDingTalk2(mes) await notify.sendNotify(`${$.name} - 您忘了种植新的水果`, `京东账号${$.index} ${$.nickName || $.UserName}\n【提醒⏰】您忘了种植新的水果\n请去京东APP或微信小程序选购并种植新的水果`); } return @@ -179,6 +185,7 @@ async function jdFruit() { } else { console.log(`初始化农场数据异常, 请登录京东 app查看农场0元水果功能是否正常,农场初始化数据: ${JSON.stringify($.farmInfo)}`); message = message + " " + `初始化农场数据异常, 请登录动动 app查看农场0元水果功能是否正常,农场初始化数据: ${JSON.stringify($.farmInfo)}` + "\n\n"; + } } catch (e) { console.log(`任务执行异常,请检查执行日志 ‼️‼️`); @@ -301,6 +308,7 @@ async function predictionFruit() { $.farmInfo.farmUserPro.treeTotalEnergy) * 100).toFixed(2)}` + "%,已浇水" + `${$.farmInfo.farmUserPro.treeEnergy / 10}` + "次,还需" + `${($.farmInfo.farmUserPro.treeTotalEnergy - $.farmInfo.farmUserPro.treeEnergy) / 10}` + "次 \n\n" + if ($.farmInfo.toFlowTimes > ($.farmInfo.farmUserPro.treeEnergy / 10)) { message += "【水果🍉进度】" + `【开花进度】再浇水${$.farmInfo.toFlowTimes - $.farmInfo.farmUserPro.treeEnergy / 10}次开花\n\n` + "\n\n" } else if ($.farmInfo.toFruitTimes > ($.farmInfo.farmUserPro.treeEnergy / 10)) { @@ -655,7 +663,7 @@ async function getExtraAward() { } } else { console.log("已经领取过5好友助力额外奖励"); - message += "【水果🍉进度】" + `【额外奖励】已被领取过\n` + "\n\n"; + message += "" + `【额外奖励】已被领取过\n` + "\n\n"; } } else { console.log("助力好友未达到5个"); @@ -738,7 +746,7 @@ async function masterHelpShare() { // helpSuccessPeoples = $.getdata(helpSuccessPeoplesKey); // } if (helpSuccessPeoples && helpSuccessPeoples.length > 0) { - message += " " + `【您助力的好友👬】${helpSuccessPeoples.substr(0, helpSuccessPeoples.length - 1)}\n` + "\n\n"; + // message += `【您助力的好友👬】${helpSuccessPeoples.substr(0, helpSuccessPeoples.length - 1)}\n`; } if (salveHelpAddWater > 0) { // message += `【助力好友👬】获得${salveHelpAddWater}g💧\n`; @@ -1554,6 +1562,7 @@ function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env + //我加的函数 function postToDingTalk(messgae) { const message1 = "" + messgae diff --git a/src/main/resources/test_trytryOne.js b/src/main/resources/test_trytryOne.js index 49dff9a..883f972 100644 --- a/src/main/resources/test_trytryOne.js +++ b/src/main/resources/test_trytryOne.js @@ -477,7 +477,7 @@ function try_MyTrials(page, selected) { count++ } if (item.text.text.includes('试用资格将保留10天')) { - message1 = "" + `${getManName}` + "\n\n" + message1 = "" + getManName + "\n\n" message1 = "" + `,你的商品待领取,请尽快领取` + "\n\n" message1 += "" + `成功获取:${item.trialName}` + "\n\n" message1 += "" + `剩余时间:${remaining(item.leftTime)}` + "\n\n"