Merge pull request #15 from lxk0301/master

Master
This commit is contained in:
any
2020-12-23 19:20:08 +08:00
committed by GitHub
25 changed files with 251 additions and 56 deletions

View File

@ -37,6 +37,7 @@ jobs:
if [ $TG_USER_ID ]; then sed -i "/variables/a\ TG_USER_ID: $TG_USER_ID" serverless.yml; fi; if [ $TG_USER_ID ]; then sed -i "/variables/a\ TG_USER_ID: $TG_USER_ID" serverless.yml; fi;
if [ $DD_BOT_TOKEN ]; then sed -i "/variables/a\ DD_BOT_TOKEN: $DD_BOT_TOKEN" serverless.yml; fi; if [ $DD_BOT_TOKEN ]; then sed -i "/variables/a\ DD_BOT_TOKEN: $DD_BOT_TOKEN" serverless.yml; fi;
if [ $DD_BOT_SECRET ]; then sed -i "/variables/a\ DD_BOT_SECRET: $DD_BOT_SECRET" serverless.yml; fi; if [ $DD_BOT_SECRET ]; then sed -i "/variables/a\ DD_BOT_SECRET: $DD_BOT_SECRET" serverless.yml; fi;
if [ $QYWX_KEY ]; then sed -i "/variables/a\ QYWX_KEY: $QYWX_KEY" serverless.yml; fi;
if [ $IGOT_PUSH_KEY ]; then sed -i "/variables/a\ IGOT_PUSH_KEY: $IGOT_PUSH_KEY" serverless.yml; fi; if [ $IGOT_PUSH_KEY ]; then sed -i "/variables/a\ IGOT_PUSH_KEY: $IGOT_PUSH_KEY" serverless.yml; fi;
if [ $QQ_SKEY ]; then sed -i "/variables/a\ QQ_SKEY: $QQ_SKEY" serverless.yml; fi; if [ $QQ_SKEY ]; then sed -i "/variables/a\ QQ_SKEY: $QQ_SKEY" serverless.yml; fi;
if [ $QQ_MODE ]; then sed -i "/variables/a\ QQ_MODE: $QQ_MODE" serverless.yml; fi; if [ $QQ_MODE ]; then sed -i "/variables/a\ QQ_MODE: $QQ_MODE" serverless.yml; fi;
@ -58,6 +59,10 @@ jobs:
if [ $SUPERMARKET_LOTTERY ]; then sed -i "/variables/a\ SUPERMARKET_LOTTERY: $SUPERMARKET_LOTTERY" serverless.yml; fi; if [ $SUPERMARKET_LOTTERY ]; then sed -i "/variables/a\ SUPERMARKET_LOTTERY: $SUPERMARKET_LOTTERY" serverless.yml; fi;
if [ $FRUIT_BEAN_CARD ]; then sed -i "/variables/a\ FRUIT_BEAN_CARD: $FRUIT_BEAN_CARD" serverless.yml; fi; if [ $FRUIT_BEAN_CARD ]; then sed -i "/variables/a\ FRUIT_BEAN_CARD: $FRUIT_BEAN_CARD" serverless.yml; fi;
if [ $UN_SUBSCRIBES ]; then sed -i "/variables/a\ UN_SUBSCRIBES: $UN_SUBSCRIBES" serverless.yml; fi; if [ $UN_SUBSCRIBES ]; then sed -i "/variables/a\ UN_SUBSCRIBES: $UN_SUBSCRIBES" serverless.yml; fi;
if [ $UN_BIND_CARD_NUM ]; then sed -i "/variables/a\ UN_BIND_CARD_NUM: $UN_BIND_CARD_NUM" serverless.yml; fi;
if [ $UN_BIND_STOP_CARD ]; then sed -i "/variables/a\ UN_BIND_STOP_CARD: $UN_BIND_STOP_CARD" serverless.yml; fi;
if [ $JDJOY_HELPSELF ]; then sed -i "/variables/a\ JDJOY_HELPSELF: $JDJOY_HELPSELF" serverless.yml; fi;
if [ $JDJOY_APPLYJDBEAN ]; then sed -i "/variables/a\ JDJOY_APPLYJDBEAN: $JDJOY_APPLYJDBEAN" serverless.yml; fi;
if [ $FRUITSHARECODES ]; then sed -i "/variables/a\ FRUITSHARECODES: $FRUITSHARECODES" serverless.yml; fi; if [ $FRUITSHARECODES ]; then sed -i "/variables/a\ FRUITSHARECODES: $FRUITSHARECODES" serverless.yml; fi;
if [ $PETSHARECODES ]; then sed -i "/variables/a\ PETSHARECODES: $PETSHARECODES" serverless.yml; fi; if [ $PETSHARECODES ]; then sed -i "/variables/a\ PETSHARECODES: $PETSHARECODES" serverless.yml; fi;
if [ $PLANT_BEAN_SHARECODES ]; then sed -i "/variables/a\ PLANT_BEAN_SHARECODES: $PLANT_BEAN_SHARECODES" serverless.yml; fi; if [ $PLANT_BEAN_SHARECODES ]; then sed -i "/variables/a\ PLANT_BEAN_SHARECODES: $PLANT_BEAN_SHARECODES" serverless.yml; fi;
@ -69,6 +74,8 @@ jobs:
if [ $TG_PROXY_PORT ]; then sed -i "/variables/a\ TG_PROXY_PORT: $TG_PROXY_PORT" serverless.yml; fi; if [ $TG_PROXY_PORT ]; then sed -i "/variables/a\ TG_PROXY_PORT: $TG_PROXY_PORT" serverless.yml; fi;
if [ $MONEY_TREE_SELL_FRUIT ]; then sed -i "/variables/a\ MONEY_TREE_SELL_FRUIT: $MONEY_TREE_SELL_FRUIT" serverless.yml; fi; if [ $MONEY_TREE_SELL_FRUIT ]; then sed -i "/variables/a\ MONEY_TREE_SELL_FRUIT: $MONEY_TREE_SELL_FRUIT" serverless.yml; fi;
if [ $FACTORAY_WANTPRODUCT_NAME ]; then sed -i "/variables/a\ FACTORAY_WANTPRODUCT_NAME: $FACTORAY_WANTPRODUCT_NAME" serverless.yml; fi; if [ $FACTORAY_WANTPRODUCT_NAME ]; then sed -i "/variables/a\ FACTORAY_WANTPRODUCT_NAME: $FACTORAY_WANTPRODUCT_NAME" serverless.yml; fi;
if [ $WATCH_ACCEPTBODY ]; then sed -i "/variables/a\ WATCH_ACCEPTBODY: $WATCH_ACCEPTBODY" serverless.yml; fi;
if [ $WATCH_DOBODY ]; then sed -i "/variables/a\ WATCH_DOBODY: $WATCH_DOBODY" serverless.yml; fi;
cat serverless.yml cat serverless.yml
env env
env: #因为直接读取secrets里面的值很多字符不会自动转译导致写入serverless.yml异常所以设置到环境变量在读取环境变量转译过的值 env: #因为直接读取secrets里面的值很多字符不会自动转译导致写入serverless.yml异常所以设置到环境变量在读取环境变量转译过的值
@ -84,6 +91,7 @@ jobs:
TG_USER_ID: ${{ secrets.TG_USER_ID}} TG_USER_ID: ${{ secrets.TG_USER_ID}}
DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}} DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN}}
DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}} DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET}}
QYWX_KEY: ${{ secrets.QYWX_KEY}}
IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}} IGOT_PUSH_KEY: ${{ secrets.IGOT_PUSH_KEY}}
QQ_SKEY: ${{ secrets.QQ_SKEY}} QQ_SKEY: ${{ secrets.QQ_SKEY}}
QQ_MODE: ${{ secrets.QQ_MODE}} QQ_MODE: ${{ secrets.QQ_MODE}}
@ -105,6 +113,10 @@ jobs:
SUPERMARKET_LOTTERY: ${{ secrets.SUPERMARKET_LOTTERY}} SUPERMARKET_LOTTERY: ${{ secrets.SUPERMARKET_LOTTERY}}
FRUIT_BEAN_CARD: ${{ secrets.FRUIT_BEAN_CARD}} FRUIT_BEAN_CARD: ${{ secrets.FRUIT_BEAN_CARD}}
UN_SUBSCRIBES: ${{ secrets.UN_SUBSCRIBES}} UN_SUBSCRIBES: ${{ secrets.UN_SUBSCRIBES}}
UN_BIND_CARD_NUM: ${{ secrets.UN_BIND_CARD_NUM}}
UN_BIND_STOP_CARD: ${{ secrets.UN_BIND_STOP_CARD}}
JDJOY_HELPSELF: ${{ secrets.JDJOY_HELPSELF}}
JDJOY_APPLYJDBEAN: ${{ secrets.JDJOY_APPLYJDBEAN}}
FRUITSHARECODES: ${{ secrets.FRUITSHARECODES}} FRUITSHARECODES: ${{ secrets.FRUITSHARECODES}}
PETSHARECODES: ${{ secrets.PETSHARECODES}} PETSHARECODES: ${{ secrets.PETSHARECODES}}
PLANT_BEAN_SHARECODES: ${{ secrets.PLANT_BEAN_SHARECODES}} PLANT_BEAN_SHARECODES: ${{ secrets.PLANT_BEAN_SHARECODES}}
@ -116,6 +128,8 @@ jobs:
TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}} TG_PROXY_PORT: ${{ secrets.TG_PROXY_PORT}}
MONEY_TREE_SELL_FRUIT: ${{ secrets.MONEY_TREE_SELL_FRUIT}} MONEY_TREE_SELL_FRUIT: ${{ secrets.MONEY_TREE_SELL_FRUIT}}
FACTORAY_WANTPRODUCT_NAME: ${{ secrets.FACTORAY_WANTPRODUCT_NAME}} FACTORAY_WANTPRODUCT_NAME: ${{ secrets.FACTORAY_WANTPRODUCT_NAME}}
WATCH_ACCEPTBODY: ${{ secrets.WATCH_ACCEPTBODY}}
WATCH_DOBODY: ${{ secrets.WATCH_DOBODY}}
- name: "部署到腾讯云函数" - name: "部署到腾讯云函数"
run: serverless deploy run: serverless deploy

View File

@ -108,6 +108,8 @@ 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 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 "10-20/5 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播

View File

@ -34,6 +34,7 @@
"10-20/5 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "10-20/5 12 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, tag=京东直播, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png",
"10 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, tag=京东健康, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_jdh.png", "10 8 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, tag=京东健康, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_jdh.png",
"14 11 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png", "14 11 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, tag=京东赚赚, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jdzz.png",
"44 12 * * 6 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, tag=注销京东店铺会员卡, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_unbind.png",
"1 0,20,9-23/2 15-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png", "1 0,20,9-23/2 15-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live_redrain.js, tag=直播红包雨, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_live_redrain.png",
"10 12 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png", "10 12 1-31 12 * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, tag=京东金融打卡, img-url= https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png",
"15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png" "15 17 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/backUp/xmSports.js, tag=小米运动, img-url=https://raw.githubusercontent.com/58xinian/icon/master/xmyd.png"

View File

@ -69,6 +69,8 @@ cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_sc
cron "20 23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, timeout=750, wake-system=1, tag=京东健康 cron "20 23 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdh.js, timeout=750, wake-system=1, tag=京东健康
#京东赚赚 #京东赚赚
cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, timeout=750, wake-system=1, tag=京东赚赚 cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_jdzz.js, timeout=750, wake-system=1, tag=京东赚赚
#注销京东店铺会员卡
cron "20 12 * * 6" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_unbind.js, timeout=750, wake-system=1, tag=注销京东店铺会员卡
#以下为短期活动 #以下为短期活动
#金融打卡领年终奖 #金融打卡领年终奖
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 7 1-31 12 *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jr_sign.js, timeout=750, wake-system=1, tag=金融打卡领年终奖

View File

@ -14,6 +14,8 @@
10 6 1-31 12 * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1 10 6 1-31 12 * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1
# 京东健康APP集汪汪卡瓜分百万红包(2021.1.6活动过期) # 京东健康APP集汪汪卡瓜分百万红包(2021.1.6活动过期)
10 8 * * * node /scripts/jd_jdh.js >> /scripts/logs/jd_jdh.log 2>&1 10 8 * * * node /scripts/jd_jdh.js >> /scripts/logs/jd_jdh.log 2>&1
# crazyJoy自动每日任务
10 7 * * * node /scripts/jd_crazy_joy.js >> /scripts/logs/jd_crazy_joy.log 2>&1
##############长期活动############## ##############长期活动##############
# 签到 # 签到
@ -84,3 +86,5 @@
10 10,11 * * * node /scripts/jd_joy_run.js >> /scripts/logs/jd_joy_run.log 2>&1 10 10,11 * * * node /scripts/jd_joy_run.js >> /scripts/logs/jd_joy_run.log 2>&1
# 京东发现-看一看看40个视频领80京豆非常耗时 # 京东发现-看一看看40个视频领80京豆非常耗时
13 11,14 * * * node /scripts/jd_watch.js >> /scripts/logs/jd_watch.log 2>&1 13 11,14 * * * node /scripts/jd_watch.js >> /scripts/logs/jd_watch.log 2>&1
# 注销京东已开的店铺会员不是注销京东plus会员个别店铺无法注销
44 4 * * 6 node /scripts/jd_unbind.js >> /scripts/logs/jd_unbind.log 2>&1

View File

@ -107,10 +107,16 @@ if [ $(grep -c "default_task.sh" $mergedListFile) -eq '0' ]; then
echo "52 */1 * * * sh /scripts/docker/default_task.sh |ts >> /scripts/logs/default_task.log 2>&1" >>$mergedListFile echo "52 */1 * * * sh /scripts/docker/default_task.sh |ts >> /scripts/logs/default_task.log 2>&1" >>$mergedListFile
fi fi
if [ $RANDOM_DELAY_MAX -ge 1 ]; then if [ $RANDOM_DELAY_MAX ];then
echo "已设置随机延迟为 $RANDOM_DELAY_MAX , 设置延迟任务中... " if [ $RANDOM_DELAY_MAX -ge 1 ]; then
sed -i "/\(jd_bean_sign.js\|jd_blueCoin.js\|jd_joy_reward.js\|jd_joy_steal.js\|jd_joy_feedPets.js\)/!s/node/sleep \$((RANDOM % \$RANDOM_DELAY_MAX)); node/g" $mergedListFile echo "已设置随机延迟为 $RANDOM_DELAY_MAX , 设置延迟任务中... "
sed -i "/\(jd_bean_sign.js\|jd_blueCoin.js\|jd_joy_reward.js\|jd_joy_steal.js\|jd_joy_feedPets.js\)/!s/node/sleep \$((RANDOM % \$RANDOM_DELAY_MAX)); node/g" $mergedListFile
fi
else
echo "未配置随即延迟对应的环境变量,故不设置延迟任务"
fi fi
echo "加载最新的定时任务文件..." echo "加载最新的定时任务文件..."
crontab $mergedListFile crontab $mergedListFile
sh -x /scripts/docker/proc_file.sh

View File

@ -28,6 +28,8 @@ jd_scripts:
#钉钉机器人通知 #钉钉机器人通知
- DD_BOT_TOKEN= - DD_BOT_TOKEN=
- DD_BOT_SECRET= - DD_BOT_SECRET=
#企业微信机器人通知
- QYWX_KEY=
#京东种豆得豆 #京东种豆得豆
- PLANT_BEAN_SHARECODES= - PLANT_BEAN_SHARECODES=
#京东农场 #京东农场

View File

@ -28,6 +28,8 @@ jd_scripts:
#钉钉机器人通知 #钉钉机器人通知
- DD_BOT_TOKEN= - DD_BOT_TOKEN=
- DD_BOT_SECRET= - DD_BOT_SECRET=
#企业微信机器人通知
- QYWX_KEY=
#京东种豆得豆 #京东种豆得豆
- PLANT_BEAN_SHARECODES= - PLANT_BEAN_SHARECODES=
#京东农场 #京东农场

View File

@ -27,6 +27,8 @@ jd_scripts:
#钉钉机器人通知 #钉钉机器人通知
- DD_BOT_TOKEN= - DD_BOT_TOKEN=
- DD_BOT_SECRET= - DD_BOT_SECRET=
#企业微信机器人通知
- QYWX_KEY=
#京东种豆得豆 #京东种豆得豆
- PLANT_BEAN_SHARECODES= - PLANT_BEAN_SHARECODES=
#京东农场 #京东农场
@ -50,4 +52,3 @@ jd_scripts:
#并不是所有的脚本都会被启用延迟因为有一些脚本需要整点触发。延迟的目的有两个1是降低抢占cpu资源几率2是降低检查风险主要是1 #并不是所有的脚本都会被启用延迟因为有一些脚本需要整点触发。延迟的目的有两个1是降低抢占cpu资源几率2是降低检查风险主要是1
#填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数执行延迟的意思。 #填写数字,单位为秒,比如写为 RANDOM_DELAY_MAX=30 就是随机产生0到29之间的一个秒数执行延迟的意思。
- RANDOM_DELAY_MAX= - RANDOM_DELAY_MAX=

54
docker/proc_file.sh Normal file
View File

@ -0,0 +1,54 @@
#!/bin/sh
echo "整理各个日志文件里面的互助码相关信息。。。"
echo "==========================================================================="
logdDir="/scripts/logs"
sharecodeFile="${logdDir}/sharecode.log"
jdzzFile="${logdDir}/jd_jdzz.log"
jdfactoryFile="${logdDir}/jd_jdfactory.log"
jxFactoryFile="${logdDir}/jd_dreamFactory.log"
plantBean="${logdDir}/jd_plantBean.log"
jdfruit="${logdDir}/jd_fruit.log"
jdpet="${logdDir}/jd_pet.log"
echo -e >$sharecodeFile
sed -n '/京东赚赚好友互助码】.*/'p $jdzzFile | awk '{print $4,$5}' | sort | uniq >>$sharecodeFile
echo "提取京东赚赚助力码完成"
sed -n '/东东工厂好友互助码】.*/'p $jdfactoryFile | awk '{print $4,$5}' | sort | uniq >>$sharecodeFile
echo "提取东东工厂助力码完成"
sed -n '/京喜工厂好友互助码.*/'p $jxFactoryFile | awk '{print $4,$5}' | sort | uniq >>$sharecodeFile
echo "提取京喜工厂助力码完成"
sed -n '/京东种豆得豆好友互助码】.*/'p $plantBean | awk '{print $4,$5}' | sort | uniq >>$sharecodeFile
echo "提取京东种豆助力码完成"
sed -n '/东东农场好友互助码】.*/'p $jdfruit | awk '{print $4,$5}' | sort | uniq >>$sharecodeFile
echo "提取京东农场助力码完成"
sed -n '/东东萌宠好友互助码】.*/'p $jdpet | awk '{print $4,$5}' | sort | uniq >>$sharecodeFile
echo "提取东东萌宠助力码完成"
echo "==========================================================================="
echo "整理完成,具体结果请查看${sharecodeFile}文件"
echo "处理jd_crazy_joy_coin任务。。。"
if [ ! $CRZAY_JOY_COIN_ENABLE ]; then
echo "默认启用jd_crazy_joy_coin杀掉jd_crazy_joy_coin任务并重启"
eval $(ps -ef | grep "jd_crazy" | awk '{print "kill "$1}')
node /scripts/jd_crazy_joy_coin.js >> /scripts/logs/jd_crazy_joy_coin.log 2>&1 &
echo "默认jd_crazy_joy_coin重启完成"
else
if [ $CRZAY_JOY_COIN_ENABLE = "Y" ]; then
echo "配置启用jd_crazy_joy_coin杀掉jd_crazy_joy_coin任务并重启"
eval $(ps -ef | grep "jd_crazy" | awk '{print "kill "$1}')
node /scripts/jd_crazy_joy_coin.js >> /scripts/logs/jd_crazy_joy_coin.log 2>&1 &
echo "配置jd_crazy_joy_coin重启完成"
else
eval $(ps -ef | grep "jd_crazy" | awk '{print "kill "$1}')
echo "已配置不启用jd_crazy_joy_coin任务不处理"
fi
fi

View File

@ -87,8 +87,9 @@
| `BARK_SOUND` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | bark推送声音设置例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` | | `BARK_SOUND` | [BARK推送](https://apps.apple.com/us/app/bark-customed-notifications/id1403753865) | 非必须 | bark推送声音设置例如`choo`,具体值请在`bark`-`推送铃声`-`查看所有铃声` |
| `TG_BOT_TOKEN` | telegram推送 | 非必须 | tg推送,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](./backUp/TG_PUSH.md) | | `TG_BOT_TOKEN` | telegram推送 | 非必须 | tg推送,填写自己申请[@BotFather](https://t.me/BotFather)的Token,如`10xxx4:AAFcqxxxxgER5uw` , [具体教程](./backUp/TG_PUSH.md) |
| `TG_USER_ID` | telegram推送 | 非必须 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](./backUp/TG_PUSH.md) | | `TG_USER_ID` | telegram推送 | 非必须 | tg推送,填写[@getuseridbot](https://t.me/getuseridbot)中获取到的纯数字ID, [具体教程](./backUp/TG_PUSH.md) |
| `DD_BOT_TOKEN` | 钉钉推送 | 非必须 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于符号后面的XXX 注:如果钉钉推送只填写`DD_BOT_TOKEN`,那么安全设置需勾选`自定义关键词`,内容输入输入`账号`即可,其他安全设置不要勾选 | | `DD_BOT_TOKEN` | 钉钉推送 | 非必须 | 钉钉推送[官方文档](https://ding-doc.dingtalk.com/doc#/serverapi2/qf2nxq) ,只需`https://oapi.dingtalk.com/robot/send?access_token=XXX` 等于`=`符号后面的XXX即可 |
| `DD_BOT_SECRET` | 钉钉推送 | 非必须 | 密钥机器人安全设置页面加签一栏下面显示的SEC开头的字符 , 注:填写了`DD_BOT_TOKEN`和`DD_BOT_SECRET`钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) | | `DD_BOT_SECRET` | 钉钉推送 | 非必须 | 密钥机器人安全设置页面加签一栏下面显示的SEC开头的`SECXXXXXXXXXX`等字符 , 注:钉钉机器人安全设置只需勾选`加签`即可,其他选项不要勾选,再不懂看 [这个图](icon/DD_bot.png) |
| `QYWX_KEY` | 企业微信推送 | 非必须 | 密钥,企业微信推送 webhook 后面的 key [详见官方说明文档](https://work.weixin.qq.com/api/doc/90000/90136/91770) |
| `IGOT_PUSH_KEY` | iGot推送 | 非必须 | iGot聚合推送支持多方式推送确保消息可达。 [参考文档](https://wahao.github.io/Bark-MP-helper ) | | `IGOT_PUSH_KEY` | iGot推送 | 非必须 | iGot聚合推送支持多方式推送确保消息可达。 [参考文档](https://wahao.github.io/Bark-MP-helper ) |
| `QQ_SKEY` | 酷推(Cool Push)推送 | 非必须 | 推送所需的Skey,登录后获取Skey [参考文档](https://cp.xuthus.cc/) | | `QQ_SKEY` | 酷推(Cool Push)推送 | 非必须 | 推送所需的Skey,登录后获取Skey [参考文档](https://cp.xuthus.cc/) |
| `QQ_MODE` | 酷推(Cool Push)推送 | 非必须 | 推送方式(send或group或者wx默认send) [参考文档](https://cp.xuthus.cc/) | | `QQ_MODE` | 酷推(Cool Push)推送 | 非必须 | 推送方式(send或group或者wx默认send) [参考文档](https://cp.xuthus.cc/) |
@ -110,6 +111,10 @@
| `SUPERMARKET_LOTTERY` | 京小超抽奖 | 非必须 | 每天运行脚本是否使用金币去抽奖,`true`表示抽奖,`false`表示不抽奖 | | `SUPERMARKET_LOTTERY` | 京小超抽奖 | 非必须 | 每天运行脚本是否使用金币去抽奖,`true`表示抽奖,`false`表示不抽奖 |
| `FRUIT_BEAN_CARD` | 农场使用水滴换豆卡 | 非必须 | 农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),`true`表示换豆(不浇水),`false`表示不换豆(继续浇水),脚本默认是浇水 | | `FRUIT_BEAN_CARD` | 农场使用水滴换豆卡 | 非必须 | 农场使用水滴换豆卡(如果出现限时活动时100g水换20豆,此时比浇水划算,推荐换豆),`true`表示换豆(不浇水),`false`表示不换豆(继续浇水),脚本默认是浇水 |
| `UN_SUBSCRIBES` | jd_unsubscribe.js | 非必须 | 共四个参数,换行隔开. 四个参数分别表示`取关商品数量`,`取关店铺数量`,`遇到此商品不再进行取关`, `遇到此店铺不再进行取关`[具体使用往下看](#取关店铺secret的说明)| | `UN_SUBSCRIBES` | jd_unsubscribe.js | 非必须 | 共四个参数,换行隔开. 四个参数分别表示`取关商品数量`,`取关店铺数量`,`遇到此商品不再进行取关`, `遇到此店铺不再进行取关`[具体使用往下看](#取关店铺secret的说明)|
| `UN_BIND_CARD_NUM` | jd_unbind.js | 非必须 | 注销京东已开的店铺会员不是注销京东plus会员个别店铺无法注销。此参数控制每次运行脚本时注销多少个店铺会员默认200。|
| `UN_BIND_STOP_CARD` | jd_unbind.js | 非必须 | 注销京东已开的店铺会员不是注销京东plus会员个别店铺无法注销。遇到此参数设定的会员卡则跳过不注销多个会员卡之间以`&`分隔,默认值"京东PLUS会员"。 |
| `JDJOY_HELPSELF` | 疯狂的joy | 非必须 | 疯狂的joy循环助力`true`表示循环助力,`false`表示不循环助力,默认不开启循环助力。|
| `JDJOY_APPLYJDBEAN` | 疯狂的joy | 非必须 | 疯狂的joy京豆兑换目前最小值为500/1000京豆默认不开启京豆兑换。|
| `FRUITSHARECODES` | 东东农场互助码 | 非必须 | 填写规则请看 [jdFruitShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdFruitShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) | | `FRUITSHARECODES` | 东东农场互助码 | 非必须 | 填写规则请看 [jdFruitShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdFruitShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
| `PETSHARECODES` | 东东萌宠互助码 | 非必须 | 填写规则请看 [jdPetShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdPetShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) | | `PETSHARECODES` | 东东萌宠互助码 | 非必须 | 填写规则请看 [jdPetShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdPetShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |
| `PLANT_BEAN_SHARECODES` | 种豆得豆互助码 | 非必须 | 填写规则请看 [jdPlantBeanShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdPlantBeanShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) | | `PLANT_BEAN_SHARECODES` | 种豆得豆互助码 | 非必须 | 填写规则请看 [jdPlantBeanShareCodes.js](https://github.com/lxk0301/jd_scripts/blob/master/jdPlantBeanShareCodes.js) 或见下方[互助码的填写规则](#互助码的填写规则) |

View File

@ -88,10 +88,11 @@ async function showMsg() {
$.msg($.name, '', `账号${$.index}${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}`, {"open-url": "https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean"}); $.msg($.name, '', `账号${$.index}${$.nickName || $.UserName}\n昨日收入:${$.incomeBean}京豆 🐶\n昨日支出:${$.expenseBean}京豆 🐶\n当前京豆:${$.beanCount}京豆 🐶${$.message}`, {"open-url": "https://bean.m.jd.com/beanDetail/index.action?resourceValue=bean"});
} }
async function bean() { async function bean() {
//前一天的0:0:0时间戳
// console.log(`北京时间零点时间戳:${parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000}`); // console.log(`北京时间零点时间戳:${parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000}`);
// console.log(`北京时间2020-10-28 06:16:05::${new Date("2020/10/28 06:16:05+08:00").getTime()}`) // console.log(`北京时间2020-10-28 06:16:05::${new Date("2020/10/28 06:16:05+08:00").getTime()}`)
// 不管哪个时区。得到都是当前时刻北京时间的时间戳 new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000 // 不管哪个时区。得到都是当前时刻北京时间的时间戳 new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000
//前一天的0:0:0时间戳
const tm = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000 - (24 * 60 * 60 * 1000); const tm = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000 - (24 * 60 * 60 * 1000);
// 今天0:0:0时间戳 // 今天0:0:0时间戳
const tm1 = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000; const tm1 = parseInt((Date.now() + 28800000) / 86400000) * 86400000 - 28800000;

View File

@ -336,6 +336,7 @@ function buyJoy(joyId) {
data = JSON.parse(data); data = JSON.parse(data);
if (data.success) { if (data.success) {
if (data.data.eventInfo) { if (data.data.eventInfo) {
await openBox(data.data.eventInfo.eventType, data.data.eventInfo.eventRecordId)
$.canBuy = false $.canBuy = false
return return
} }
@ -433,8 +434,9 @@ function getCoin() {
}) })
} }
function openBox(boxId) { function openBox(eventType = 'LUCKY_BOX_DROP', boxId) {
let body = {"eventType": "LUCKY_BOX_DROP", "eventRecordId": boxId} console.log(`openBox:${eventType}`)
let body = { eventType, "eventRecordId": boxId}
return new Promise(async resolve => { return new Promise(async resolve => {
$.get(taskUrl('crazyJoy_event_getVideoAdvert', JSON.stringify(body)), async (err, resp, data) => { $.get(taskUrl('crazyJoy_event_getVideoAdvert', JSON.stringify(body)), async (err, resp, data) => {
try { try {
@ -445,9 +447,11 @@ function openBox(boxId) {
if (safeGet(data)) { if (safeGet(data)) {
data = JSON.parse(data); data = JSON.parse(data);
if (data['success']) { if (data['success']) {
$.log(`点击幸运盒子成功,剩余观看视频次数:${data.data.advertViewTimes}等待30秒`) $.log(`点击幸运盒子成功,剩余观看视频次数:${data.data.advertViewTimes}, ${data.data.advertViewTimes > 0 ? '等待30秒' : '跳出'}`)
await $.wait(30000) if (data.data.advertViewTimes > 0) {
await rewardBox(boxId) await $.wait(30000)
await rewardBox(eventType, boxId);
}
} }
} }
} }
@ -460,8 +464,8 @@ function openBox(boxId) {
}) })
} }
function rewardBox(boxId) { function rewardBox(eventType, boxId) {
let body = {"eventType": "LUCKY_BOX_DROP", "eventRecordId": boxId} let body = { eventType, "eventRecordId": boxId}
return new Promise(async resolve => { return new Promise(async resolve => {
$.get(taskUrl('crazyJoy_event_obtainAward', JSON.stringify(body)), async (err, resp, data) => { $.get(taskUrl('crazyJoy_event_obtainAward', JSON.stringify(body)), async (err, resp, data) => {
try { try {

View File

@ -547,7 +547,7 @@ function userInfo() {
} }
console.log(`当前电力:${data.user.electric}`) console.log(`当前电力:${data.user.electric}`)
console.log(`当前等级:${data.user.currentLevel}`) console.log(`当前等级:${data.user.currentLevel}`)
console.log(`分享码: ${data.user.encryptPin}`); console.log(`\n【京东账号${$.index}${$.nickName || $.UserName})的${$.name}好友互助码】${data.user.encryptPin}`);
console.log(`已投入电力:${production.investedElectric}`); console.log(`已投入电力:${production.investedElectric}`);
console.log(`所需电力:${production.needElectric}`); console.log(`所需电力:${production.needElectric}`);
console.log(`生产进度:${((production.investedElectric / production.needElectric) * 100).toFixed(2)}%`); console.log(`生产进度:${((production.investedElectric / production.needElectric) * 100).toFixed(2)}%`);

View File

@ -85,7 +85,7 @@ async function jdFruit() {
// option['media-url'] = $.farmInfo.farmUserPro.goodsImage; // option['media-url'] = $.farmInfo.farmUserPro.goodsImage;
subTitle = `【京东账号${$.index}${$.nickName}`; subTitle = `【京东账号${$.index}${$.nickName}`;
message = `【水果名称】${$.farmInfo.farmUserPro.name}\n`; message = `【水果名称】${$.farmInfo.farmUserPro.name}\n`;
console.log(`\n${$.name}互助码shareCode】 ${$.farmInfo.farmUserPro.shareCode}\n`); console.log(`\n京东账号${$.index}${$.nickName || $.UserName}${$.name}好友互助码${$.farmInfo.farmUserPro.shareCode}\n`);
console.log(`\n【已成功兑换水果】${$.farmInfo.farmUserPro.winTimes}\n`); console.log(`\n【已成功兑换水果】${$.farmInfo.farmUserPro.winTimes}\n`);
message += `【已兑换水果】${$.farmInfo.farmUserPro.winTimes}\n`; message += `【已兑换水果】${$.farmInfo.farmUserPro.winTimes}\n`;
await masterHelpShare();//助力好友 await masterHelpShare();//助力好友

View File

@ -446,7 +446,7 @@ function jdfactory_getTaskDetail() {
$.taskVos = data.data.result.taskVos;//任务列表 $.taskVos = data.data.result.taskVos;//任务列表
$.taskVos.map(item => { $.taskVos.map(item => {
if (item.taskType === 14) { if (item.taskType === 14) {
console.log(`\n${$.name}好友助力邀请码:${item.assistTaskDetailVo.taskToken}\n`) console.log(`\n【京东账号${$.index}${$.nickName || $.UserName}${$.name}好友互助码】${item.assistTaskDetailVo.taskToken}\n`)
} }
}) })
} }

View File

@ -255,7 +255,7 @@ function getUserInfo() {
if (safeGet(data)) { if (safeGet(data)) {
data = JSON.parse(data); data = JSON.parse(data);
if (data.data.shareTaskRes) { if (data.data.shareTaskRes) {
console.log(`\n${$.name}好友助力码为: ${data.data.shareTaskRes.itemId}\n`); console.log(`\n【京东账号${$.index}${$.nickName || $.UserName}${$.name}好友互助码】${data.data.shareTaskRes.itemId}\n`);
} else { } else {
console.log(`已满5人助力,暂时看不到您的${$.name}好友助力码`) console.log(`已满5人助力,暂时看不到您的${$.name}好友助力码`)
} }

View File

@ -1,4 +1,5 @@
/* /*
TODO 能力补给站(2人赛跑可加5KM50人赛跑可加25KM),抽空添加
jd宠汪汪 搬的https://github.com/uniqueque/QuantumultX/blob/4c1572d93d4d4f883f483f907120a75d925a693e/Script/jd_joy.js jd宠汪汪 搬的https://github.com/uniqueque/QuantumultX/blob/4c1572d93d4d4f883f483f907120a75d925a693e/Script/jd_joy.js
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js 脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
IOS用户支持京东双账号,NodeJs用户支持N个京东账号 IOS用户支持京东双账号,NodeJs用户支持N个京东账号

File diff suppressed because one or more lines are too long

View File

@ -115,7 +115,7 @@ async function jdPet() {
} }
return return
} }
console.log(`\n${$.name}互助码shareCode】 ${$.petInfo.shareCode}\n`); console.log(`\n京东账号${$.index}${$.nickName || $.UserName}${$.name}好友互助码${$.petInfo.shareCode}\n`);
await taskInit(); await taskInit();
if ($.taskInit.resultCode === '9999' || !$.taskInit.result) { if ($.taskInit.resultCode === '9999' || !$.taskInit.result) {
console.log('初始化任务异常, 请稍后再试'); console.log('初始化任务异常, 请稍后再试');

View File

@ -89,7 +89,7 @@ async function jdPlantBean() {
if ($.plantBeanIndexResult.code === '0') { if ($.plantBeanIndexResult.code === '0') {
const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl const shareUrl = $.plantBeanIndexResult.data.jwordShareInfo.shareUrl
$.myPlantUuid = getParam(shareUrl, 'plantUuid') $.myPlantUuid = getParam(shareUrl, 'plantUuid')
console.log(`\n${$.name}互助码】 ${$.myPlantUuid}\n`); console.log(`\n京东账号${$.index}${$.nickName || $.UserName}${$.name}好友互助码】${$.myPlantUuid}\n`);
roundList = $.plantBeanIndexResult.data.roundList; roundList = $.plantBeanIndexResult.data.roundList;
currentRoundId = roundList[1].roundId;//本期的roundId currentRoundId = roundList[1].roundId;//本期的roundId
lastRoundId = roundList[0].roundId;//上期的roundId lastRoundId = roundList[0].roundId;//上期的roundId

View File

@ -2,7 +2,7 @@
* @Author: lxk0301 https://github.com/lxk0301 * @Author: lxk0301 https://github.com/lxk0301
* @Date: 2020-11-12 11:42:12 * @Date: 2020-11-12 11:42:12
* @Last Modified by: lxk0301 * @Last Modified by: lxk0301
* @Last Modified time: 2020-12-11 14:27:20 * @Last Modified time: 2020-12-23 14:27:20
*/ */
/* /*
东东小窝 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js 东东小窝 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js
@ -45,6 +45,7 @@ const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
//IOS等用户直接用NobyDa的jd cookie //IOS等用户直接用NobyDa的jd cookie
let cookiesArr = [], cookie = '', message = ''; let cookiesArr = [], cookie = '', message = '';
let isPurchaseShops = false;//是否一键加购商品到购物车,默认不加购 let isPurchaseShops = false;//是否一键加购商品到购物车,默认不加购
$.helpToken = [];
if ($.isNode()) { if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => { Object.keys(jdCookieNode).forEach((item) => {
cookiesArr.push(jdCookieNode[item]) cookiesArr.push(jdCookieNode[item])
@ -92,12 +93,13 @@ const JD_API_HOST = 'https://lkyl.dianpusoft.cn/api';
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];
$.token = $.helpToken[i];
$.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1]) $.UserName = decodeURIComponent(cookie.match(/pt_pin=(.+?);/) && cookie.match(/pt_pin=(.+?);/)[1])
if ($.newShareCodes.length > 1) { if ($.newShareCodes.length > 1) {
let code = $.newShareCodes[(i + 1) % $.newShareCodes.length] console.log('----', (i + 1) % $.newShareCodes.length)
console.log(`\n${$.UserName}去给自己的下一账号${decodeURIComponent(cookiesArr[(i + 1) % $.newShareCodes.length].match(/pt_pin=(.+?);/) && cookiesArr[(i + 1) % $.newShareCodes.length].match(/pt_pin=(.+?);/)[1])}助力\n`) let code = $.newShareCodes[(i + 1) % $.newShareCodes.length]['code']
$.log(`自己的下一账号${decodeURIComponent(cookiesArr[(i + 1) % $.newShareCodes.length].match(/pt_pin=(.+?);/) && cookiesArr[(i + 1) % $.newShareCodes.length].match(/pt_pin=(.+?);/)[1])},助力码为 ${code}`) console.log(`\n${$.UserName} 去给自己的下一账号 ${decodeURIComponent($.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=(.+?);/) && $.newShareCodes[(i + 1) % $.newShareCodes.length]['cookie'].match(/pt_pin=(.+?);/)[1])}助力,助力码为 ${code}\n`)
await createAssistUser(code, $.createAssistUserID || "1318106976846299138"); await createAssistUser(code, $.createAssistUserID);
} }
console.log(`\n去帮助作者:lxk0301\n`) console.log(`\n去帮助作者:lxk0301\n`)
await helpFriends(); await helpFriends();
@ -153,7 +155,7 @@ async function helpFriends() {
if (!$.inviteCodes) await updateInviteCodeCDN('https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateSmallHomeInviteCode.json'); if (!$.inviteCodes) await updateInviteCodeCDN('https://gitee.com/lxk0301/updateTeam/raw/master/jd_updateSmallHomeInviteCode.json');
for (let item of $.inviteCodes.inviteCode) { for (let item of $.inviteCodes.inviteCode) {
if (!item) continue if (!item) continue
await createAssistUser(item, $.createAssistUserID || "1318106976846299138"); await createAssistUser(item, $.createAssistUserID);
} }
} }
async function doAllTask() { async function doAllTask() {
@ -165,8 +167,8 @@ async function doAllTask() {
for (let item of $.taskList) { for (let item of $.taskList) {
if (item.ssjjTaskInfo.type === 1) { if (item.ssjjTaskInfo.type === 1) {
//邀请好友助力自己 //邀请好友助力自己
// await createAssistUser('1330186694770339842', item.ssjjTaskInfo.id)
$.createAssistUserID = item.ssjjTaskInfo.id; $.createAssistUserID = item.ssjjTaskInfo.id;
console.log(`createAssistUserID:${item.ssjjTaskInfo.id}`)
console.log(`\n\n助力您的好友:${item.doneNum}`) console.log(`\n\n助力您的好友:${item.doneNum}`)
} }
if (item.ssjjTaskInfo.type === 2) { if (item.ssjjTaskInfo.type === 2) {
@ -504,7 +506,7 @@ function createInviteUser() {
if (data.body.id) { if (data.body.id) {
console.log(`\n您的${$.name}shareCode(每天都是变化的):【${data.body.id}\n`); console.log(`\n您的${$.name}shareCode(每天都是变化的):【${data.body.id}\n`);
$.shareCode = data.body.id; $.shareCode = data.body.id;
$.newShareCodes.push(data.body.id); $.newShareCodes.push({ 'code': data.body.id, 'token': $.token, cookie });
} }
} }
} }
@ -520,6 +522,7 @@ function createInviteUser() {
} }
function createAssistUser(inviteId, taskId) { function createAssistUser(inviteId, taskId) {
console.log(`${inviteId}, ${taskId}`, `${cookie}`);
return new Promise(resolve => { return new Promise(resolve => {
$.get(taskUrl(`/ssjj-task-record/createAssistUser/${inviteId}/${taskId}`), (err, resp, data) => { $.get(taskUrl(`/ssjj-task-record/createAssistUser/${inviteId}/${taskId}`), (err, resp, data) => {
try { try {
@ -771,6 +774,7 @@ function login(userName) {
data = JSON.parse(data); data = JSON.parse(data);
if (data.head.code === 200) { if (data.head.code === 200) {
$.token = data.head.token; $.token = data.head.token;
$.helpToken.push(data.head.token)
} }
} }
} catch (e) { } catch (e) {

File diff suppressed because one or more lines are too long

View File

@ -43,6 +43,11 @@ let DD_BOT_TOKEN = '';
//密钥机器人安全设置页面加签一栏下面显示的SEC开头的字符串 //密钥机器人安全设置页面加签一栏下面显示的SEC开头的字符串
let DD_BOT_SECRET = ''; let DD_BOT_SECRET = '';
// =======================================企业微信机器人通知设置区域===========================================
//此处填你企业微信机器人的 webhook(详见文档 https://work.weixin.qq.com/api/doc/90000/90136/91770)例如693a91f6-7xxx-4bc4-97a0-0ec2sifa5aaa
//注此处设置github action用户填写到Settings-Secrets里面(Name输入QYWX_KEY)
let QYWX_KEY = '';
// =======================================iGot聚合推送通知设置区域=========================================== // =======================================iGot聚合推送通知设置区域===========================================
//此处填您iGot的信息(推送key例如https://push.hellyw.com/XXXXXXXX) //此处填您iGot的信息(推送key例如https://push.hellyw.com/XXXXXXXX)
//注此处设置github action用户填写到Settings-Secrets里面Name输入IGOT_PUSH_KEY //注此处设置github action用户填写到Settings-Secrets里面Name输入IGOT_PUSH_KEY
@ -99,6 +104,10 @@ if (process.env.DD_BOT_TOKEN) {
} }
} }
if (process.env.QYWX_KEY) {
QYWX_KEY = process.env.QYWX_KEY;
}
if (process.env.IGOT_PUSH_KEY) { if (process.env.IGOT_PUSH_KEY) {
IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY IGOT_PUSH_KEY = process.env.IGOT_PUSH_KEY
} }
@ -121,6 +130,7 @@ async function sendNotify(text, desp, params = {}) {
await BarkNotify(text, desp, params);//iOS Bark APP await BarkNotify(text, desp, params);//iOS Bark APP
await tgBotNotify(text, desp);//telegram 机器人 await tgBotNotify(text, desp);//telegram 机器人
await ddBotNotify(text, desp);//钉钉机器人 await ddBotNotify(text, desp);//钉钉机器人
await qywxBotNotify(text, desp); //企业微信机器人
await iGotNotify(text, desp, params);//iGot await iGotNotify(text, desp, params);//iGot
await CoolPush(text, desp);//QQ酷推 await CoolPush(text, desp);//QQ酷推
} }
@ -355,6 +365,47 @@ function ddBotNotify(text, desp) {
}) })
} }
function qywxBotNotify(text, desp) {
return new Promise(resolve => {
const options = {
url: `https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${QYWX_KEY}`,
json: {
msgtype: 'text',
text: {
content: ` ${text}\n\n${desp}`,
},
},
headers: {
'Content-Type': 'application/json',
},
};
if (QYWX_KEY) {
$.post(options, (err, resp, data) => {
try {
if (err) {
console.log('企业微信发送通知消息失败!!\n');
console.log(err);
} else {
data = JSON.parse(data);
if (data.errcode === 0) {
console.log('企业微信发送通知消息完成。\n');
} else {
console.log(`${data.errmsg}\n`);
}
}
} catch (e) {
$.logErr(e, resp);
} finally {
resolve(data);
}
});
} else {
console.log('您未提供企业微信机器人推送所需的QYWX_KEY取消企业微信推送消息通知\n');
resolve();
}
});
}
function iGotNotify(text, desp, params={}){ function iGotNotify(text, desp, params={}){
return new Promise(resolve => { return new Promise(resolve => {
if (IGOT_PUSH_KEY) { if (IGOT_PUSH_KEY) {

View File

@ -46,12 +46,12 @@ inputs:
cronExpression: "0 0 0-16/8,20 * * * *" cronExpression: "0 0 0-16/8,20 * * * *"
enable: true enable: true
argument: jd_joy_reward&jd_joy_steal&jd_necklace&jd_live argument: jd_joy_reward&jd_joy_steal&jd_necklace&jd_live
- timer: # 京东全民开红包 # 进店领豆 # 取关京东店铺商品# 京东抽奖机# 东东小窝# 秒杀红包雨# 健康抽奖机 - timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #注销京东会员卡 #京东抽奖机 #东东小窝 #秒杀红包雨 #健康抽奖机
parameters: parameters:
name: redPacket_shop_unsubscribe_lotteryMachine_small_home_ms_redrain_health name: redPacket_shop_unsubscribe_unbind_lotteryMachine_small_home_ms_redrain_health
cronExpression: "0 10 0 * * * *" cronExpression: "0 10 0 * * * *"
enable: true enable: true
argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_lotteryMachine&jd_small_home&jd_ms_redrain&jd_health argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_unbind&jd_lotteryMachine&jd_small_home&jd_ms_redrain&jd_health
- timer: # 京东天天加速# 天天提鹅 - timer: # 京东天天加速# 天天提鹅
parameters: parameters:
name: jd_speed_jd_daily_egg name: jd_speed_jd_daily_egg
@ -64,12 +64,12 @@ inputs:
cronExpression: "0 15 * * * * *" cronExpression: "0 15 * * * * *"
enable: true enable: true
argument: jd_superMarket argument: jd_superMarket
- timer: # 京豆变动通知 # 京东排行榜 # 领京豆额外奖励 # 京东汽车 #京东健康APP - timer: #京豆变动通知 #疯狂的joy #京东排行榜 #领京豆额外奖励 #京东汽车 #京东健康APP
parameters: parameters:
name: bean_change_rankingList_bean_home_car_jdh name: bean_change_crazy_joy_rankingList_bean_home_car_jdh
cronExpression: "0 30 7 * * * *" cronExpression: "0 30 7 * * * *"
enable: true enable: true
argument: jd_bean_change&jd_rankingList&jd_bean_home&jd_car&jd_jdh argument: jd_bean_change&jd_crazy_joy&jd_rankingList&jd_bean_home&jd_car&jd_jdh
- timer: #金融养猪 #十元街 #京东快递 #发现-看一看 #京东赚赚 #金融打卡领年终奖 - timer: #金融养猪 #十元街 #京东快递 #发现-看一看 #京东赚赚 #金融打卡领年终奖
parameters: parameters:
name: pigPet_syj_kd_watch_jdzz_jr_sign name: pigPet_syj_kd_watch_jdzz_jr_sign