From 497bdfa3cfe58f2297041295bdbfd2b7f5140d1e Mon Sep 17 00:00:00 2001 From: anonymous Date: Sun, 24 Jan 2021 15:50:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90?= =?UTF-8?q?=E9=A6=96=E9=A1=B5Readme=E4=B8=AD=E7=9A=84=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=B8=85=E5=8D=95=EF=BC=8C=E6=97=A0=E9=9C=80?= =?UTF-8?q?=E5=86=8D=E4=BA=BA=E5=B7=A5=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=AF=B7?= =?UTF-8?q?=E5=8B=BF=E5=88=A0=E9=99=A4Readme=E4=B8=AD=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=9A=84=E6=A0=87=E8=AE=B0=E8=A1=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update_list.yml | 35 +++++++++++++++++++++++++++++++ README.md | 16 +++++++++----- update_list.sh | 26 +++++++++++++++++++++++ 3 files changed, 72 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/update_list.yml create mode 100644 update_list.sh diff --git a/.github/workflows/update_list.yml b/.github/workflows/update_list.yml new file mode 100644 index 00000000..3256aeff --- /dev/null +++ b/.github/workflows/update_list.yml @@ -0,0 +1,35 @@ +name: update_list + + +on: + workflow_dispatch: + schedule: + - cron: '1 5,17 * * *' + repository_dispatch: + types: update_list + #push: + # branches: [ master ] +jobs: + build: + runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + repository: ${{ github.repository }} + + - name: "更新Readme中脚本清单列表" + run: | + bash update_list.sh + - name: commit + run: | + git config --global user.email ${{ secrets.EMAIL }} + git config --global user.name lxk0301 + git add . + git commit -m "更新Readme中脚本清单列表 by lxk0301 Github Action" -a || echo "Nothing to update" + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.TOKEN }} + branch: master diff --git a/README.md b/README.md index fc6ea14a..87d61f0c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,9 @@ 2. 以字母排序。 + + + | 活动时长 | 名称 | 脚本 | | -------- | --------------------------------- | -------------------------------------------------------------------------------------------------------- | | 长期 | 京豆变动通知 | [jd_bean_change.js](https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_bean_change.js) | @@ -73,18 +76,18 @@ | 长期 | 注销京东会员卡 | [jd_unbind.js](https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_unbind.js) | | 长期 | 取关京东店铺和商品 | [jd_unsubscribe.js](https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_unsubscribe.js) | | 长期 | 京喜签到 | [jx_sign.js](https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jx_sign.js) | + + + + +#### 搬运脚本 -搬运脚本 1. 【[@yangtingxiao](https://github.com/yangtingxiao)】京东抽奖机([jd_lotteryMachine.js](https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_lotteryMachine.js)) 2. 【[@yangtingxiao](https://github.com/yangtingxiao)】京东排行榜([jd_rankingList.js](https://raw.githubusercontent.com/LXK9301/jd_scripts/master/jd_rankingList.js)) **脚本兼容: [QuantumultX](https://apps.apple.com/us/app/quantumult-x/id1443988620), [Surge](https://apps.apple.com/us/app/surge-4/id1442620678), [Loon](https://apps.apple.com/us/app/loon/id1373567447), 小火箭, JSBox, Node.js** -**TODO** - -- [x] 所有活动互助码在一个脚本打印 - ## 邀请码互助 - [邀请码互助入口](https://github.com/LXK9301/jd_scripts/discussions) @@ -126,9 +129,11 @@ ### 4. iOS代理软件(QuantumultX, Surge, Loon, 小火箭) ##### 获取京东cookie + - [京东cookie获取脚本 JD_extra_cookie.js](https://raw.githubusercontent.com/LXK9301/jd_scripts/master/JD_extra_cookie.js) ##### 订阅链接: + - Surge:Task&Cookies脚本模块地址: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Surge/lxk0301_Task.sgmodule.sgmodule - Loon:Task&Cookies脚本订阅链接: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/Loon/lxk0301_LoonTask.conf @@ -136,6 +141,7 @@ - QuantumultX Task脚本订阅链接: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/QuantumultX/lxk0301_gallery.json - QuantumultX cookie脚本订阅链接: https://raw.githubusercontent.com/LXK9301/jd_scripts/master/QuantumultX/lxk0301_cookies.conf + ## 赞赏码(开发维护不易,请赏杯茶水费)
diff --git a/update_list.sh b/update_list.sh new file mode 100644 index 00000000..42f7bab0 --- /dev/null +++ b/update_list.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +## 网址、路径、文件、标记信息以及表头 +WorkDir=$(cd $(dirname $0); pwd) +JsList=($(cd $WorkDir; ls *.js | grep -E "j[drx]_")) +FileReadme=$WorkDir/README.md +UrlBlob=https://github.com/LXK9301/jd_scripts/blob/master/ +UrlRaw=https://raw.githubusercontent.com/LXK9301/jd_scripts/master/ +SheetHead="| 序号 | 名称 | blob文件链接 | raw文件链接 |\n| ---- | ------- | ------------ | ----------- |" + +## 删除标记行的内容 +StartLine=$(($(grep -n "标记开始" "$FileReadme" | awk -F ":" '{print $1}') + 1)) +EndLine=$(($(grep -n "标记结束" "$FileReadme" | awk -F ":" '{print $1}') - 1)) +Tail=$(perl -ne "$. > $EndLine && print" "$FileReadme") +perl -i -ne "{print unless $StartLine .. eof}" "$FileReadme" + +## 生成新的表格并写入Readme +cd $WorkDir +Sheet=$SheetHead +for ((i=0; i<${#JsList[*]}; i++)); do + Name=$(grep "new Env" ${JsList[i]} | awk -F "'|\"" '{print $2}') + Blob="$UrlBlob${JsList[i]}" + Raw="$UrlRaw${JsList[i]}" + Sheet="$Sheet\n| $(($i + 1)) | $Name | [${JsList[i]}]($Blob) | [${JsList[i]}]($Raw) |" +done +echo -e "$Sheet\n$Tail" >> $FileReadme \ No newline at end of file From eaee88c442da497a199b1821f42062d950e5c32f Mon Sep 17 00:00:00 2001 From: anonymous Date: Sun, 24 Jan 2021 15:58:21 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- update_list.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/update_list.sh b/update_list.sh index 42f7bab0..d56877cd 100644 --- a/update_list.sh +++ b/update_list.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +## Author: https://github.com/EvineDeng +## Modified: 2021-01-24 +## Version: v1.0.0 + ## 网址、路径、文件、标记信息以及表头 WorkDir=$(cd $(dirname $0); pwd) JsList=($(cd $WorkDir; ls *.js | grep -E "j[drx]_")) From cb44f709343fca8d14c730aabd05c54d056b38ec Mon Sep 17 00:00:00 2001 From: anonymous Date: Sun, 24 Jan 2021 16:13:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Docker=E9=97=AA=E8=B4=AD?= =?UTF-8?q?=E7=9B=B2=E7=9B=92=E5=92=8C=E9=9B=86=E9=9E=AD=E7=82=AE=E8=B5=A2?= =?UTF-8?q?=E4=BA=AC=E8=B1=86=E7=9A=84cron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/crontab_list.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index 2b097535..ccceddd4 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -99,5 +99,9 @@ 27 7 * * * node /scripts/jd_cash.js >> /scripts/logs/jd_cash.log 2>&1 # 京喜app签到 39 7 * * * node /scripts/jx_sign.js >> /scripts/logs/jx_sign.log 2>&1 -#京东家庭号(暂不知最佳cron) -#*/20 * * * * node /scripts/jd_family.js >> /scripts/logs/jd_family.log 2>&1 +# 京东家庭号(暂不知最佳cron) +# */20 * * * * node /scripts/jd_family.js >> /scripts/logs/jd_family.log 2>&1 +# 闪购盲盒 +27 8 * * * node /scripts/jd_sgmh.js >> /scripts/logs/jd_sgmh.log 2>&1 +# 集鞭炮赢京豆 +38 8,21 * * * node /scripts/jd_firecrackers.js >> /scripts/logs/jd_firecrackers.log 2>&1 From 042dfd5b6e1685a6e2f5c64ee9c8909afaf6ecc1 Mon Sep 17 00:00:00 2001 From: anonymous Date: Sun, 24 Jan 2021 16:14:14 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E9=9B=86=E9=9E=AD=E7=82=AE=E8=B5=A2?= =?UTF-8?q?=E4=BA=AC=E8=B1=86=E4=B8=BA=E7=9F=AD=E6=9C=9F=E6=B4=BB=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/crontab_list.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker/crontab_list.sh b/docker/crontab_list.sh index ccceddd4..f1476648 100644 --- a/docker/crontab_list.sh +++ b/docker/crontab_list.sh @@ -16,8 +16,11 @@ 50 0,1,8 * * * node /scripts/jd_nian_ar.js >> /scripts/logs/jd_nian_ar.log 2>&1 #京东炸年兽小程序 50 0,1,8 * * * node /scripts/jd_nian_wechat.js >> /scripts/logs/jd_nian_wechat.log 2>&1 +# 集鞭炮赢京豆 +38 8,21 * * * node /scripts/jd_firecrackers.js >> /scripts/logs/jd_firecrackers.log 2>&1 #京东神仙书院(活动时间:2021-1-20至2021-2-5) 30 6 * * * node /scripts/jd_immortal.js >> /scripts/logs/jd_immortal.log 2>&1 + ##############长期活动############## # 签到 0 0,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1 @@ -103,5 +106,3 @@ # */20 * * * * node /scripts/jd_family.js >> /scripts/logs/jd_family.log 2>&1 # 闪购盲盒 27 8 * * * node /scripts/jd_sgmh.js >> /scripts/logs/jd_sgmh.log 2>&1 -# 集鞭炮赢京豆 -38 8,21 * * * node /scripts/jd_firecrackers.js >> /scripts/logs/jd_firecrackers.log 2>&1