1
This commit is contained in:
@@ -91,13 +91,13 @@ 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=京东快递签到
|
||||
|
||||
# 京东汽车
|
||||
cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车
|
||||
cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车
|
||||
|
||||
# 领京豆额外奖励
|
||||
cron "10 7 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励
|
||||
@@ -107,19 +107,19 @@ 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=健康抽奖机
|
||||
cron "10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js,tag=健康抽奖机
|
||||
# 疯狂的joy日常任务
|
||||
cron "30 8 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_crazy_joy.js,tag=疯狂的joy日常任务
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
"0 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_syj.js, tag=十元街, img-url=https://github.com/58xinian/icon/raw/master/jd_syj.png",
|
||||
"15 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ms_redrain.js, tag=秒杀红包雨, img-url=https://raw.githubusercontent.com/Orz-3/task/master/jd.png",
|
||||
"10 6 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_bean_home.js, tag=领京豆额外奖励, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_bean_home.png",
|
||||
"20 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png",
|
||||
"0 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, tag=京东汽车, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_car.png",
|
||||
"10 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, tag=京东快递签到, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_kd.png",
|
||||
"30 7 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_ds.js, tag=京东代属, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_ds.png",
|
||||
"30 0 * * * https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, tag=健康抽奖机, img-url=https://raw.githubusercontent.com/58xinian/icon/master/jd_redPacket.png",
|
||||
|
||||
14
README.md
14
README.md
@@ -68,8 +68,10 @@
|
||||
**TODO**
|
||||
- [ ] 所有活动互助码在一个脚本打印
|
||||
|
||||
## [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions)
|
||||
|
||||
## 邀请码互助
|
||||
- [邀请码互助入口](https://github.com/lxk0301/jd_scripts/discussions)
|
||||
- [获取各类活动互助码脚本 jd_get_share_code.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_get_share_code.js)
|
||||
- [邀请码使用规范](githubAction.md#互助码类环境变量)(仅限云端)
|
||||
## 食用方法
|
||||
|
||||
### 方法一:本地安装Node.js,下载本库脚本
|
||||
@@ -85,9 +87,9 @@
|
||||
### 方法二:云服务器、腾讯云函数等等
|
||||
|
||||
- 需自行有云服务器,云函数等
|
||||
- 腾讯云云函数 [快速部署教程](tencentscf.md)(免费)
|
||||
- 腾讯云云函数控制台使用 [教程说明](iCloud.md)
|
||||
- 腾讯云云函数 [GitHub Action部署教程](tencentscf.md#github-action-部署)
|
||||
- 腾讯云云函数 [快速部署教程](./backUp/tencentscf.md)(免费)
|
||||
- 腾讯云云函数控制台使用 [教程说明](./backUp/iCloud.md)
|
||||
- 腾讯云云函数 [GitHub Action部署教程](./backUp/tencentscf.md#github-action-部署)
|
||||
|
||||
|
||||
### 方法三:Docker(NAS或VPS用户)
|
||||
@@ -107,7 +109,7 @@
|
||||
|
||||
### 方法四:iOS系统的代理软件(QuantumultX, Surge, Loon, 小火箭)
|
||||
|
||||
#### [京东cookie获取脚本](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js)
|
||||
- [京东cookie获取脚本 JD_extra_cookie.js](https://raw.githubusercontent.com/lxk0301/jd_scripts/master/JD_extra_cookie.js)
|
||||
|
||||
### 赞赏码(开发维护不易,请赏杯茶水费)
|
||||
<div align=center><img width="250" height="250" src="https://raw.githubusercontent.com/lxk0301/jd_scripts/master/icon/thanks.jpg"/></div>
|
||||
|
||||
@@ -53,18 +53,14 @@ 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=领京豆额外奖励
|
||||
#京东汽车
|
||||
cron "30 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, timeout=750, wake-system=1, tag=京东汽车
|
||||
cron "0 0 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_car.js, timeout=750, wake-system=1, tag=京东汽车
|
||||
#京东快递签到
|
||||
cron "20 11 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_kd.js, timeout=750, wake-system=1, tag=京东快递签到
|
||||
#京东直播(活动结束时间未知)
|
||||
cron "20 12 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_live.js, timeout=750, wake-system=1, tag=京东直播
|
||||
#京东看一看
|
||||
cron "40 9,10 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_watch.js, timeout=7750, 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=京东健康
|
||||
#京东赚赚
|
||||
@@ -74,12 +70,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=秒杀红包雨
|
||||
cron "30 2 * * *" script-path=https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_health.js, timeout=750, wake-system=1, tag=健康抽奖机
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
220
activity/jd_ds.js
Normal file
220
activity/jd_ds.js
Normal file
File diff suppressed because one or more lines are too long
435
activity/jd_jdh.js
Normal file
435
activity/jd_jdh.js
Normal file
File diff suppressed because one or more lines are too long
@@ -498,7 +498,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
282
activity/jd_live_redrain.js
Normal file
282
activity/jd_live_redrain.js
Normal file
File diff suppressed because one or more lines are too long
208
activity/jd_ms_redrain.js
Normal file
208
activity/jd_ms_redrain.js
Normal file
File diff suppressed because one or more lines are too long
@@ -330,7 +330,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
418
activity/jd_watch.js
Normal file
418
activity/jd_watch.js
Normal file
File diff suppressed because one or more lines are too long
199
activity/jr_sign.js
Normal file
199
activity/jr_sign.js
Normal file
File diff suppressed because one or more lines are too long
208
backUp/iCloud.md
Normal file
208
backUp/iCloud.md
Normal file
@@ -0,0 +1,208 @@
|
||||
## 1.安装 Node.js 环境
|
||||
|
||||
[下载地址](https://nodejs.org/zh-tw/download/ )
|
||||
|
||||
根据自己的操作系统下载
|
||||
|
||||
傻瓜式安装,一直下一步即可。
|
||||
|
||||
|
||||
|
||||
## 2.下载源码
|
||||
|
||||

|
||||
|
||||
点击红框处下载压缩包
|
||||
|
||||
## 3.安装依赖、增加入口文件、增加cookie
|
||||
|
||||
压缩包解压后进入项目文件夹
|
||||
|
||||
- Windows 用户按住 **shift** 点击右键,点击 **在此处打开命令窗口**
|
||||
- Mac 用户通过终端,自行进入该文件夹
|
||||
|
||||
在命令行内输入 `npm i `,等待运行完成。
|
||||
|
||||
此时,项目文件夹内会多出一个 `node_modules`文件夹
|
||||
|
||||
**增加入口文件**
|
||||
|
||||
方案一:同一个仓库下同一个时间,执行多个脚本
|
||||
|
||||
在项目文件夹内新建 `index.js`
|
||||
|
||||
编辑文件
|
||||
|
||||
```javascript
|
||||
'use strict';
|
||||
exports.main_handler = async (event, context, callback) => {
|
||||
//解决云函数热启动问题
|
||||
delete require.cache[require.resolve('./jd_xtg1.js')];
|
||||
require('./jd_xtg1.js') //这里写你想要的脚本
|
||||
require('./jd_xtg2.js') //这里写你想要的脚本
|
||||
require('./jd_xtg3.js') //这里写你想要的脚本
|
||||
}
|
||||
|
||||
```
|
||||
此时,同一时间点下,会同时执行多个脚本,触发器触发后,index.js文件中require()下的所有脚本都会被执行
|
||||
|
||||
**优点**:同一时间下可以同时执行多个脚本,适合脚本种类少的repository,对脚本数量少的repository推荐使用此方案<br>**缺点**:多个脚本不同时间点运行无法满足
|
||||
|
||||
方案二:同一个仓库下不同的时间点,分别执行不同的脚本(类似GitHub Action执行机制)
|
||||
|
||||
在项目文件夹内新建 `index.js`
|
||||
|
||||
编辑文件
|
||||
|
||||
```javascript
|
||||
'use strict';
|
||||
exports.main_handler = async (event, context, callback) => {
|
||||
for (const v of event["Message"].split("\r\n")) {
|
||||
//解决云函数热启动问题
|
||||
delete require.cache[require.resolve(`./${v}.js`)];
|
||||
console.log(v);
|
||||
require(`./${v}.js`)
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
此时触发管理按照下图中进行设置,附加信息选择“是”,内容填写需要传递执行的具体脚本文件名,以回车键换行。触发器触发后,附加信息栏内的脚本会被执行,设置多个不同时间点的触发器达到类似GitHub Action的效果
|
||||
|
||||
**优点**:可以满足个性化需求,同一个repository下只需要设置不同的触发器,可以实现不同时间点分别执行不同的脚本<br>**缺点**:repository下脚本过多,如果需要设置多个触发器,实现个性化运行效果,由于云函数的限制,最多只能设置10个
|
||||
|
||||
[](https://imgchr.com/i/B20KxI)
|
||||
[](https://imgchr.com/i/BRCG0H)
|
||||
|
||||
**注意:**<br>
|
||||
Ⅰ方案一与方案二不能混合到同一个index.js文件中使用,同一个仓库下,二者只能选择其一。<br>
|
||||
Ⅱ感谢[issues#115](https://github.com/lxk0301/jd_scripts/issues/115)中的解决方案,目前云函数连续测试已经可以规避热启动问题了。<br>
|
||||
Ⅲ在确保完全按照本教程设置的情况下测试云函数运行情况,对于部分人运行日志中出现某些脚本运行失败其他正常,并且错误提示带有strict字样的,请自行删除index.js中的```'use strict';```,再做测试<br>
|
||||
|
||||
**增加cookie**
|
||||
|
||||
打开项目文件内的 `jdCookie.js`
|
||||
|
||||
在最上面的 `CookieJDs`里写入 cookie ,多个账号以逗号分隔
|
||||
|
||||
例如
|
||||
|
||||
```javascript
|
||||
let CookieJDs = [
|
||||
'pt_key=xxx;pt_pin=xxx;',
|
||||
'pt_key=zzz;pt_pin=zzz;',
|
||||
'pt_key=aaa;pt_pin=xxxaaa'
|
||||
]
|
||||
```
|
||||
|
||||
|
||||
|
||||
## 4.上传至腾讯云
|
||||
|
||||
[腾讯云函数地址]( https://console.cloud.tencent.com/scf/index )
|
||||
|
||||
编写函数
|
||||
|
||||
登录后,点击管理控制台
|
||||
|
||||
单击左侧导航栏**函数服务**,进入“函数服务”页面。
|
||||
在页面上方选择一个地域,最好选择离你常用地区近点的,不至于导致账号异常。单击**新建**。如下图所示:
|
||||
|
||||

|
||||
|
||||
在“新建函数”页面填写函数基础信息,单击**下一步**。如下图所示:
|
||||
|
||||

|
||||
|
||||
**函数名称**:可以自定义,比如为jd。<br>**运行环境**:选择 “Nodejs 12.16”。<br>**创建方式**:选择 “空白函数”。
|
||||
|
||||
确保环境为Nodejs 12.16,执行方法改为:index.main_handler,提交方式建议选本地文件夹,然后从GitHub项目克隆Zip压缩包,解压成文件夹,然后点击这个上传把文件夹上传进来(记得node_modules文件夹一并上传或者将node_modules文件夹上传到“层”,之后选择“函数管理”-“层管理”绑定上传好的层),完了后点击下面的高级设置。
|
||||
|
||||

|
||||
|
||||
内存用不了太大,64MB就够了(64M内存,免费时长6,400,000秒,内存与免费时长大致关系可以参看云函数官方说明),超时时间改为最大的900秒,然后点击最下面的完成。
|
||||
|
||||

|
||||
|
||||
## 5.设置触发器
|
||||
|
||||
点击刚创建的函数
|
||||
|
||||

|
||||
|
||||
点击如图所示
|
||||
|
||||

|
||||
|
||||
创建触发器
|
||||
|
||||

|
||||
|
||||
触发方式默认“**定时触发**”,定时任务名称随便起个名字,触发周期根据自己需要自行设置。
|
||||
|
||||
想进阶使用触发器的自行查看本文中方案一和方案二中的说明
|
||||
|
||||
关于触发周期中的自定义触发周期,使用的是 Cron表达式,这个自行学习下吧
|
||||
|
||||
|
||||
[Corn文档](https://cloud.tencent.com/document/product/583/9708#cron-.E8.A1.A8.E8.BE.BE.E5.BC.8F)
|
||||
|
||||
目前repo中按照每个脚本一个定时器的方式设置到云函数中,大约需要触发器10多个,由于云函数触发器限制最多10个,需要对触发器进行整合,整合后触发器保持在10个以内,以下设置仅供参考<br>
|
||||
|
||||
| **JavaScript** | **脚本名称** | **活动时间** | **原Repository UTC时间** | **适用于云函数的北京时间** | **serverless.yml** |
|
||||
| :----------------------: | :----------------------: | :----------: | :-----------------------: | :-------------------------: | :----------------: |
|
||||
| `jd_bean_change` | 京豆变动通知 | 长期 | 0 2 * * * | 0 1 */1 * * | 30 7 * * * |
|
||||
| `jd_bean_home` | 领京豆额外奖励 | 长期 | / | 0 1 */1 * * | 30 7 * * * |
|
||||
| `jd_bean_sign` | 京豆签到 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * |
|
||||
| `jd_blueCoin` | 京小超兑换奖品 | 长期 | 0 16 * * * | 0 1 */1 * * | 0 0 * * * |
|
||||
| `jd_car` | 京东汽车 | 长期 | / | 0 0 */1 * * | 0 0 * * * |
|
||||
| `jd_club_lottery` | 摇京豆 | 长期 | 0 16 * * * | 0 0 */1 * * | 0 0 * * * |
|
||||
| `jd_crazy_joy` | 疯狂的joy | 长期 | / | / | 30 7 * * * |
|
||||
| `jd_crazy_joy_coin` | 疯狂的joy挂机 | 长期 | / | / | / |
|
||||
| `jd_daily_egg` | 京东金融-天天提额 | 长期 | 10 */3 * * * | 0-12/3 */3 * * * | 8 */3 * * * |
|
||||
| `jd_dreamFactory` | 京喜工厂 | 长期 | / | */30 * * * * | 3 */1 * * * |
|
||||
| `jd_ds` | 京东代属(校园用户) | 长期 | / | / | / |
|
||||
| `jd_fruit` | 东东农场 | 长期 | 20 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * |
|
||||
| `jd_health` | 健康抽奖机 | 短期 | / | 0 0 */1 * * | 10 0 * * * |
|
||||
| `jd_jdfactory` | 东东工厂 | 长期 | / | */30 * * * * | 3 */1 * * * |
|
||||
| `jd_jdh` | 京东健康APP | 短期 | / | / | 30 7 * * * |
|
||||
| `jd_jdzz` | 京东赚赚 | 长期 | / | / | 3 1 * * * |
|
||||
| `jd_joy` | 宠汪汪 | 长期 | 0 0,1,4,10,15,16 * * * | 0,5,10 8,9,12,18,23,0 * * * | 3 */1 * * * |
|
||||
| `jd_joy_feedPets` | 宠汪汪单独喂食 | 长期 | */20 */1 * * * | 0-12/3 */3 * * * | 3 */1 * * * |
|
||||
| `jd_joy_help` | 宠汪汪强制为别人助力 | 长期 | / | / | / |
|
||||
| `jd_joy_reward` | 宠汪汪兑换奖品 | 长期 | 0 0,4,8,16 * * * | 0 8,12,16,0 */1 * * | 0 0-16/8,20 * * * |
|
||||
| `jd_joy_run` | 宠汪汪邀请助力与赛跑助力 | 长期 | / | / | / |
|
||||
| `jd_joy_steal` | 宠汪汪偷好友狗粮与积分 | 长期 | 0 16,22 * * * | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * |
|
||||
| `jd_kd` | 京东快递 | 长期 | / | 0 1 */1 * * | 3 1 * * * |
|
||||
| `jd_live` | 京东直播18豆 | 长期 | / | / | 0 0-16/8,20 * * * |
|
||||
| `jd_live_redrain` | 超级直播间红包雨 | 短期 | / | 0 0,20,9-23/2 * * MON-FRI | / |
|
||||
| `jd_lotteryMachine` | 京东抽奖机 | 长期 | 11 17 * * * | 0 0 */1 * * | 10 0 * * * |
|
||||
| `jd_moneyTree` | 摇钱树 | 长期 | 40 */3 * * * | 0-12/3 */3 * * * | 3 */1 * * * |
|
||||
| `jd_ms_redrain` | 秒杀红包雨 | 短期 | / | 0 1 */1 * * | 10 0 * * * |
|
||||
| `jd_necklace` | 点点券 | 长期 | / | 0 0,6,20 */1 * * | 0 0-16/8,20 * * * |
|
||||
| `jd_pet` | 东东萌宠 | 长期 | 35 23,4,10 * * * | 0,5,10 8,9,12,18,23,0 * * * | 5 6-18/6 * * * |
|
||||
| `jd_petTreasureBox` | 宠汪汪聚宝盆 | 长期 | / | / | / |
|
||||
| `jd_pigPet` | 京东金融-养猪猪 | 长期 | / | 0-12/3 */3 * * * | 3 1 * * * |
|
||||
| `jd_plantBean` | 种豆得豆 | 长期 | 0 23,0-14/1 * * * | 0-12/3 */3 * * * | 3 */1 * * * |
|
||||
| `jd_rankingList` | 京东排行榜 | 长期 | 11 18 * * * | 0 0 */1 * * | 30 7 * * * |
|
||||
| `jd_redPacket` | 全民开红包 | 长期 | 0 17 * * * | 0 1 */1 * * | 10 0 * * * |
|
||||
| `jd_shop` | 进店领豆 | 长期 | 0 16 * * * | 0 0 */1 * * | 10 0 * * * |
|
||||
| `jd_small_home` | 东东小窝 | 长期 | / | 0 0,6,20 */1 * * | 10 0 * * * |
|
||||
| `jd_speed` | 天天加速 | 长期 | 33 */3 * * * | 0-12/3 */3 * * * | 8 */3 * * * |
|
||||
| `jd_superMarket` | 东东超市 | 长期 | 15 * * * * | */30 * * * * | 15 * * * * |
|
||||
| `jd_syj` | 十元街 | 长期 | / | 0 1 */1 * * | 3 1 * * * |
|
||||
| `jd_unbind` | 注销京东会员卡 | 长期 | / | / | 10 0 * * * |
|
||||
| `jd_unsubscribe` | 取关京东店铺和商品 | 长期 | 45 15 * * * | 0 1 */1 * * | 10 0 * * * |
|
||||
| `jd_watch` | 发现-看一看 | 长期 | / | / | 3 1 * * * |
|
||||
| `jr_sign` | 金融打卡年终奖 | 短期 | / | / | 3 1 * * * |
|
||||
| `jd_818` | 京东手机狂欢城 | 短期 | 0 1,4,7,10,12,16,22 * * * | 0 9,12,15,16,20,0,6 */1 * * | / |
|
||||
| `jd_apple_live` | 苹果抽奖机 | 短期 | / | / | / |
|
||||
| `jd_collectProduceScore` | 双十一活动领金币 | 短期 | 30 * * * * | */30 * * * * | / |
|
||||
| `jd_digital_floor` | 数码加购京豆 | 短期 | / | / | / |
|
||||
| `jd_jxstory` | 京喜故事 | 短期 | / | / | / |
|
||||
| `jd_mohe` | 热8超级魔盒 | 短期 | / | / | / |
|
||||
| `jd_pubg` | PUBG | 短期 | / | / | / |
|
||||
| `jd_split` | 金榜年终奖 | 短期 | / | / | / |
|
||||
| `jd_xtg` | 双十一星推官 | 短期 | 0 16 * * * | 0 0 */1 * * | / |
|
||||
|
||||
点击提交,所有流程就结束了。
|
||||
138
backUp/iOS_Weather_AQI_Standard.js
Normal file
138
backUp/iOS_Weather_AQI_Standard.js
Normal file
File diff suppressed because one or more lines are too long
128
backUp/tencentscf.md
Normal file
128
backUp/tencentscf.md
Normal file
@@ -0,0 +1,128 @@
|
||||
|
||||
# 云函数快速部署京东脚本
|
||||
>
|
||||
> - 本地安装依赖使用serverless部署,[点这里](tencentscf.md#1-安装-nodejs-环境)
|
||||
> - Github Action 部署[点这里](tencentscf.md#github-action-部署)
|
||||
|
||||
## 1. 安装 Node.js 环境
|
||||
|
||||
Node.js 环境 [下载地址](https://nodejs.org/zh-tw/download/) ,根据自己的操作系统下载和安装。
|
||||
|
||||
## 2. 下载代码
|
||||
|
||||
点击红框处下载压缩包
|
||||

|
||||
|
||||
## 3. 安装依赖,配置 cookie
|
||||
|
||||
### 3.1 安装依赖
|
||||
|
||||
压缩包解压后进入项目文件夹
|
||||
|
||||
- Windows 用户按住 **shift** 点击右键,点击 **在此处打开命令窗口**
|
||||
- Mac 用户通过终端,自行进入该文件夹
|
||||
|
||||
在命令行内输入 `npm i `,等待运行完成。
|
||||
|
||||
此时,项目文件夹内会多出一个 `node_modules`文件夹
|
||||
|
||||
### 3.2 配置 cookie
|
||||
|
||||
打开项目文件内的 `jdCookie.js`
|
||||
|
||||
在最上面的 `CookieJDs`里写入 cookie ,多个账号以逗号分隔
|
||||
|
||||
例如
|
||||
|
||||
```javascript
|
||||
let CookieJDs = [
|
||||
'pt_key=xxx;pt_pin=xxx;',
|
||||
'pt_key=zzz;pt_pin=zzz;',
|
||||
'pt_key=aaa;pt_pin=xxxaaa'
|
||||
]
|
||||
```
|
||||
|
||||
> 注:获取京东 cookie 教程参考 [浏览器获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie.md) , [插件获取京东cookie教程](https://github.com/lxk0301/jd_scripts/blob/master/backUp/GetJdCookie2.md)
|
||||
|
||||
|
||||
## 4. 部署到云函数
|
||||
|
||||
### 4.1 开通服务
|
||||
|
||||
依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole**
|
||||
|
||||
> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。
|
||||
|
||||
### 4.2 工具部署
|
||||
|
||||
下载 Serverless 工具,快速部署函数
|
||||
```
|
||||
npm install -g serverless
|
||||
```
|
||||
|
||||
执行部署命令
|
||||
```
|
||||
serverless deploy
|
||||
```
|
||||
|
||||
如果已经配置了永久秘钥,则可以直接部署,如果没有,可以直接**微信扫码**登录腾讯云,并且授权部署。
|
||||
|
||||
过几秒后,查看输出,可以看到函数和定时触发器都已经配置完成。
|
||||
```
|
||||
serverless ⚡framework
|
||||
Action: "deploy" - Stage: "dev" - App: "jdscript" - Instance: "jdscript"
|
||||
|
||||
functionName: scf-jdscript
|
||||
description: This is a function in jdscript application.
|
||||
namespace: default
|
||||
runtime: Nodejs12.16
|
||||
handler: index.main_handler
|
||||
memorySize: 64
|
||||
lastVersion: $LATEST
|
||||
traffic: 1
|
||||
triggers:
|
||||
timer:
|
||||
- timer-jdscript-dev
|
||||
|
||||
36s › jdscript › Success
|
||||
```
|
||||
|
||||
## 5. 查看和测试
|
||||
|
||||
登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。
|
||||
|
||||
在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。
|
||||
|
||||

|
||||
|
||||
> 如果需要配置永久秘钥,则可以在[访问秘钥页面](https://console.cloud.tencent.com/cam/capi)获取账号的 TENCENT_SECRET_ID,TENCENT_SECRET_KEY,并配置在代码根目录 .env 文件中。
|
||||
|
||||
|
||||
# Github Action 部署
|
||||
## 1. 开通服务
|
||||
|
||||
依次登录 [SCF 云函数控制台](https://console.cloud.tencent.com/scf) 和 [SLS 控制台](https://console.cloud.tencent.com/sls) 开通相关服务,确保账户下已开通服务并创建相应[服务角色](https://console.cloud.tencent.com/cam/role) **SCF_QcsRole、SLS_QcsRole**
|
||||
|
||||
> 注意!为了确保权限足够,获取这两个参数时不要使用子账户!此外,腾讯云账户需要[实名认证](https://console.cloud.tencent.com/developer/auth)。
|
||||
|
||||
## 2. 在这里新建一个访问密钥[新建密钥](https://console.cloud.tencent.com/cam/capi)
|
||||
> 将SecretId和SecretKey分别配置在仓库的secrets变量里面, TENCENT_SECRET_ID对应你的SecretId的值,TENCENT_SECRET_KEY对应你的SecretKey的值
|
||||
|
||||
## 3. 配置自己需要secrets变量[参考这里](githubAction.md#下方提供使用到的-secrets全集合)
|
||||
### __重要的说三遍__
|
||||
### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接
|
||||
### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接
|
||||
### 如果涉及一个变量配置多个值,如多个cookie,多个取消订阅关键字,去掉里面的 *__[空格]()__* 和 __*[换行]()*__ 使用 `&` 连接
|
||||
> 排查问题第一步先看自己[腾讯云函数](https://console.cloud.tencent.com/scf/list-detail?rid=5&ns=default&id=scf-jdscript)那边的环境变量跟自己在仓库配置的 `secrets` 是否一致
|
||||

|
||||
|
||||
|
||||
## 4.执行action workflow进行部署,workflow未报错即部署成功
|
||||

|
||||
## 5. 查看和测试
|
||||
登录后,在 [腾讯云函数地址](https://console.cloud.tencent.com/scf/index) 点击管理控制台,查看最新部署的函数。
|
||||
|
||||
在左侧栏的日志查询中,可以查看到触发的日志,包括是否打卡成功等。
|
||||
|
||||

|
||||
## 6. 设置触发器[看这里](iCloud.md#5设置触发器) 或者看这里的[注释说明](https://github.com/iouAkira/jd_scripts/blob/patch-1/index.js#L4)
|
||||
@@ -1,4 +1,24 @@
|
||||
### Usage
|
||||
```diff
|
||||
+ 2021-01-03更新 增加 CUSTOM_SHELL_FILE 参数配置执行自定义shell脚本
|
||||
+ 例1:配置远程shell脚本, 我自己写了一个shell脚本https://raw.githubusercontent.com/iouAkira/someDockerfile/master/jd_scripts/shell_script_mod.sh 内容很简单下载惊喜农场并添加定时任务
|
||||
+ CUSTOM_SHELL_FILE=https://raw.githubusercontent.com/iouAkira/someDockerfile/master/jd_scripts/shell_script_mod.sh
|
||||
+
|
||||
+ 例2:配置docker挂载本地自定义shell脚本,/scripts/docker/shell_script_mod.sh 为你在docker-compose.yml里面挂载到容器里面绝对路径
|
||||
+ CUSTOM_SHELL_FILE=/scripts/docker/shell_script_mod.sh
|
||||
+
|
||||
+ tip:如果使用远程自定义,请保证网络畅通或者选择合适的国内仓库,例如有部分人的容器里面就下载不到github的raw文件,那就可以把自己的自定义shell写在gitee上,或者换本地挂载
|
||||
+ 如果是 docker 挂载本地,请保重文件挂载进去了,并且配置的是绝对路径。
|
||||
+ 自定义 shell 脚本里面如果要加 crontab 任务请使用 echo 追加到 /scripts/docker/merged_list_file.sh 里面否者不生效
|
||||
+ 注⚠️ 建议无shell能力的不要轻易使用,当然你可以找别人写好适配了这个docker镜像的脚本直接远程配置
|
||||
+ 上面写了这么多如果还看不懂,不建议使用该变量功能。
|
||||
_____
|
||||
! ⚠️⚠️⚠️2020-12-11更新镜像启动方式,虽然兼容旧版的运行启动方式,但是强烈建议更新镜像和配置后使用
|
||||
! 更新后`command:`指令配置不再需要
|
||||
! 更新后可以使用自定义任务文件追加在默任务文件之后,比以前的完全覆盖多一个选择
|
||||
! - 新的自定两个环境变量为 `CUSTOM_LIST_MERGE_TYPE`:自定文件的生效方式可选值为`append`,`overwrite`默认为`append` ; `CUSTOM_LIST_FILE`: 自定义文件的名字
|
||||
! 更新镜像增减镜像更新通知,以后镜像如果更新之后,会通知用户更新
|
||||
```
|
||||
> 推荐使用`docker-compose`所以这里只介绍`docker-compose`使用方式
|
||||
|
||||
- `docker-compose` 安装(群晖nas docker自带安装了docker-compose)
|
||||
@@ -21,12 +41,6 @@ pip install docker-compose
|
||||
|
||||
### 如果需要使用 docker 多个账户独立并发执行定时任务,[参考这里](https://github.com/iouAkira/scripts/blob/patch-1/docker/docker%E5%A4%9A%E8%B4%A6%E6%88%B7%E4%BD%BF%E7%94%A8%E7%8B%AC%E7%AB%8B%E5%AE%B9%E5%99%A8%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.md#%E4%BD%BF%E7%94%A8%E6%AD%A4%E6%96%B9%E5%BC%8F%E8%AF%B7%E5%85%88%E7%90%86%E8%A7%A3%E5%AD%A6%E4%BC%9A%E4%BD%BF%E7%94%A8docker%E5%8A%9E%E6%B3%95%E4%B8%80%E7%9A%84%E4%BD%BF%E7%94%A8%E6%96%B9%E5%BC%8F)
|
||||
|
||||
⚠️⚠️⚠️2020-12-11更新镜像启动方式,虽然兼容旧版的运行启动方式,但是强烈建议更新镜像和配置后使用
|
||||
- 更新后`command:`指令配置不再需要
|
||||
- 更新后可以使用自定义任务文件追加在默任务文件之后,比以前的完全覆盖多一个选择
|
||||
- - 新的自定两个环境变量为 `CUSTOM_LIST_MERGE_TYPE`:自定文件的生效方式可选值为`append`,`overwrite`默认为`append` ; `CUSTOM_LIST_FILE`: 自定义文件的名字
|
||||
- 更新镜像增减镜像更新通知,以后镜像如果更新之后,会通知用户更新
|
||||
|
||||
> 注⚠️:前提先理解学会使用这下面的教程
|
||||
### 创建一个目录`jd_scripts`用于存放备份配置等数据,迁移重装的时候只需要备份整个jd_scripts目录即可
|
||||
需要新建的目录文件结构参考如下:
|
||||
|
||||
@@ -4,19 +4,8 @@
|
||||
50 23 */3 * * rm -rf /scripts/logs/*.log
|
||||
|
||||
##############短期活动##############
|
||||
# 秒杀红包雨(2020.12.31活动过期)
|
||||
40 8 1-31 12 * node /scripts/jd_ms_redrain.js >> /scripts/logs/jd_ms_redrain.log 2>&1
|
||||
# 健康抽奖机(2020.12.31活动过期)
|
||||
10 0 1-31 12 * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1
|
||||
# 直播红包雨(2020.12.31活动过期)
|
||||
1 0,20,9-23/2 15-31 12 * node /scripts/jd_live_redrain.js >> /scripts/logs/jd_live_redrain.log 2>&1
|
||||
# 京东金融打卡领年终奖(2020.12.31活动过期)
|
||||
10 6 1-31 12 * node /scripts/jr_sign.js >> /scripts/logs/jr_sign.log 2>&1
|
||||
# 京东健康APP集汪汪卡瓜分百万红包(2021.1.6活动过期)
|
||||
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
|
||||
|
||||
10 0 * * * node /scripts/jd_health.js >> /scripts/logs/jd_health.log 2>&1
|
||||
##############长期活动##############
|
||||
# 签到
|
||||
0 0,18 * * * cd /scripts && node jd_bean_sign.js >> /scripts/logs/jd_bean_sign.log 2>&1
|
||||
@@ -71,11 +60,11 @@
|
||||
# 十元街
|
||||
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京豆)
|
||||
33 2 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1
|
||||
0 0 * * * node /scripts/jd_car.js >> /scripts/logs/jd_car.log 2>&1
|
||||
# 领京豆额外奖励(每日可获得3京豆)
|
||||
33 4 * * * node /scripts/jd_bean_home.js >> /scripts/logs/jd_bean_home.log 2>&1
|
||||
# 京东直播(每日18豆)
|
||||
@@ -84,7 +73,7 @@
|
||||
10 11 * * * node /scripts/jd_jdzz.js >> /scripts/logs/jd_jdzz.log 2>&1
|
||||
# 宠汪汪邀请助力
|
||||
10 10,11 * * * node /scripts/jd_joy_run.js >> /scripts/logs/jd_joy_run.log 2>&1
|
||||
# 京东发现-看一看,看40个视频领80京豆(非常耗时)
|
||||
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
|
||||
# crazyJoy自动每日任务
|
||||
10 7 * * * node /scripts/jd_crazy_joy.js >> /scripts/logs/jd_crazy_joy.log 2>&1
|
||||
|
||||
@@ -107,7 +107,7 @@ 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
|
||||
fi
|
||||
|
||||
if [ $RANDOM_DELAY_MAX ];then
|
||||
if [ $RANDOM_DELAY_MAX ]; then
|
||||
if [ $RANDOM_DELAY_MAX -ge 1 ]; then
|
||||
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
|
||||
@@ -116,6 +116,27 @@ else
|
||||
echo "未配置随即延迟对应的环境变量,故不设置延迟任务"
|
||||
fi
|
||||
|
||||
##增加自定义shell脚本
|
||||
if [ 0"$CUSTOM_SHELL_FILE" = "0" ]; then
|
||||
echo "未配置自定shell脚本文件,跳过执行。"
|
||||
else
|
||||
if expr "$CUSTOM_SHELL_FILE" : 'http.*' &>/dev/null; then
|
||||
echo "自定义shell脚本为远程脚本,开始下在自定义远程脚本。"
|
||||
wget -O /scripts/docker/shell_script_mod.sh $CUSTOM_SHELL_FILE
|
||||
echo "下载完成,开始执行..."
|
||||
sh -x /scripts/docker/shell_script_mod.sh
|
||||
echo "自定义远程shell脚本下载并执行结束。"
|
||||
else
|
||||
if [ !$CUSTOM_SHELL_FILE ]; then
|
||||
echo "自定义shell脚本为docker挂载脚本文件,但是指定挂载文件不存在,跳过执行。"
|
||||
else
|
||||
echo "docker挂载的自定shell脚本,开始执行..."
|
||||
sh -x $CUSTOM_SHELL_FILE
|
||||
echo "docker挂载的自定shell脚本,执行结束。"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "加载最新的定时任务文件..."
|
||||
crontab $mergedListFile
|
||||
|
||||
|
||||
13
jdCookie.js
13
jdCookie.js
@@ -15,19 +15,14 @@ if (process.env.JD_COOKIE) {
|
||||
} else if (process.env.JD_COOKIE.indexOf('\n') > -1) {
|
||||
console.log(`您的cookie选择的是用换行隔开\n`)
|
||||
CookieJDs = process.env.JD_COOKIE.split('\n');
|
||||
} else if (process.env.JD_COOKIE.indexOf('\\n') > -1) {
|
||||
//环境变量兼容腾讯云和docker下\n会被转义成\\n
|
||||
console.log(`您的cookie选择的是用换行隔开\\n`)
|
||||
CookieJDs = process.env.JD_COOKIE.split('\\n');
|
||||
} else {
|
||||
CookieJDs = [process.env.JD_COOKIE];
|
||||
}
|
||||
CookieJDs = [...new Set(CookieJDs)]
|
||||
console.log(`\n====================共有${CookieJDs.length}个京东账号Cookie=========\n`);
|
||||
console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`)
|
||||
// console.log(`\n==================脚本执行来自 github action=====================\n`)
|
||||
}
|
||||
CookieJDs = [...new Set(CookieJDs.filter(item => item !== "" && item !== null && item !== undefined))]
|
||||
console.log(`\n====================共有${CookieJDs.length}个京东账号Cookie=========\n`);
|
||||
console.log(`==================脚本执行- 北京时间(UTC+8):${new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000).toLocaleString()}=====================\n`)
|
||||
for (let i = 0; i < CookieJDs.length; i++) {
|
||||
const index = (i + 1 === 1) ? '' : (i + 1);
|
||||
exports['CookieJD' + index] = CookieJDs[i];
|
||||
exports['CookieJD' + index] = CookieJDs[i].trim();
|
||||
}
|
||||
|
||||
@@ -112,11 +112,15 @@ const JD_API_HOST = 'https://api.m.jd.com/';
|
||||
|
||||
async function jdBeanHome() {
|
||||
$.doneState = false
|
||||
for (let i = 0; i < 3; ++i) {
|
||||
// for (let i = 0; i < 3; ++i) {
|
||||
// await doTask2()
|
||||
// await $.wait(1000)
|
||||
// if ($.doneState) break
|
||||
// }
|
||||
do {
|
||||
await doTask2()
|
||||
await $.wait(1000)
|
||||
if ($.doneState) break
|
||||
}
|
||||
await $.wait(3000)
|
||||
} while (!$.doneState)
|
||||
await $.wait(1000)
|
||||
await award("feeds")
|
||||
await $.wait(1000)
|
||||
@@ -142,10 +146,16 @@ function doTask2() {
|
||||
} else {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
if(data.code === '0' && data.data){
|
||||
if (data.code === '0' && data.data){
|
||||
console.log(`任务完成进度:${data.data.taskProgress} / ${data.data.taskThreshold}`)
|
||||
if(data.data.taskProgress===data.data.taskThreshold)
|
||||
if(data.data.taskProgress === data.data.taskThreshold)
|
||||
$.doneState = true
|
||||
} else if (data.code === '0' && data.errorCode === 'HT201') {
|
||||
$.doneState = true
|
||||
} else {
|
||||
//HT304风控用户
|
||||
$.doneState = true
|
||||
console.log(`做任务异常:${JSON.stringify(data)}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
京豆签到,自用,可N个京东账号,IOS软件用户请使用 https://raw.githubusercontent.com/NobyDa/Script/master/JD-DailyBonus/JD_DailyBonus.js
|
||||
Node.JS专用
|
||||
更新时间:2020-12-21
|
||||
更新时间:2021-1-4
|
||||
从 github @ruicky改写而来
|
||||
version v0.0.1
|
||||
create by ruicky
|
||||
@@ -17,6 +17,7 @@ const download = require('download');
|
||||
let resultPath = "./result.txt";
|
||||
let JD_DailyBonusPath = "./JD_DailyBonus.js";
|
||||
let outPutUrl = './';
|
||||
let NodeSet = 'CookieSet.json';
|
||||
let cookiesArr = [], cookie = '';
|
||||
|
||||
if ($.isNode()) {
|
||||
@@ -130,6 +131,7 @@ async function downFile () {
|
||||
async function changeFile (content) {
|
||||
console.log(`开始替换变量`)
|
||||
let newContent = content.replace(/var Key = ''/, `var Key = '${cookie}'`);
|
||||
newContent = newContent.replace(/const NodeSet = 'CookieSet.json'/, `const NodeSet = '${NodeSet}'`)
|
||||
if (process.env.JD_BEAN_STOP && process.env.JD_BEAN_STOP !== '0') {
|
||||
newContent = newContent.replace(/var stop = 0/, `var stop = ${process.env.JD_BEAN_STOP * 1}`);
|
||||
}
|
||||
@@ -219,6 +221,7 @@ function requireConfig() {
|
||||
resultPath = err ? '/tmp/result.txt' : resultPath;
|
||||
JD_DailyBonusPath = err ? '/tmp/JD_DailyBonus.js' : JD_DailyBonusPath;
|
||||
outPutUrl = err ? '/tmp/' : outPutUrl;
|
||||
NodeSet = err ? '/tmp/CookieSet.json' : NodeSet;
|
||||
resolve()
|
||||
});
|
||||
})
|
||||
|
||||
@@ -666,7 +666,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +204,12 @@ async function jdJxStory() {
|
||||
await $.wait(1000)
|
||||
await getJoyShop()
|
||||
await $.wait(1000)
|
||||
if ($.joyIds && $.joyIds.length > 0) {
|
||||
$.log('当前JOY分布情况')
|
||||
$.log(`\n${$.joyIds[0]} ${$.joyIds[1]} ${$.joyIds[2]} ${$.joyIds[3]}`)
|
||||
$.log(`${$.joyIds[4]} ${$.joyIds[5]} ${$.joyIds[6]} ${$.joyIds[7]}`)
|
||||
$.log(`${$.joyIds[8]} ${$.joyIds[9]} ${$.joyIds[10]} ${$.joyIds[11]}\n`)
|
||||
}
|
||||
for (let i = 0; i < $.joyIds.length; ++i) {
|
||||
if (!$.canBuy) {
|
||||
$.log(`金币不足,跳过购买`)
|
||||
@@ -280,8 +286,14 @@ function getJoyShop() {
|
||||
data = JSON.parse(data);
|
||||
if (data.success && data.data && data.data.shop) {
|
||||
const shop = data.data.shop.filter(vo => vo.status === 1) || []
|
||||
$.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1
|
||||
$.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity
|
||||
$.buyJoyLevel = shop.length ? shop[shop.length - 1]['joyId'] : 1;//可购买的最大等级
|
||||
if ($.isNode() && process.env.BUY_JOY_LEVEL) {
|
||||
$.log(`当前可购买的最高JOY等级为${$.buyJoyLevel}级\n`)
|
||||
$.buyJoyLevel = (process.env.BUY_JOY_LEVEL * 1) > $.buyJoyLevel ? $.buyJoyLevel : process.env.BUY_JOY_LEVEL * 1;
|
||||
$.cost = shop[$.buyJoyLevel - 1]['coins']
|
||||
} else {
|
||||
$.cost = shop.length ? shop[shop.length - 1]['coins'] : Infinity
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
@@ -34,7 +34,7 @@ const randomCount = $.isNode() ? 20 : 5;
|
||||
let tuanActiveId = `6S9y4sJUfA2vPQP6TLdVIQ==`;
|
||||
const jxOpenUrl = `openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://wqsd.jd.com/pingou/dream_factory/index.html%22%20%7D`;
|
||||
let cookiesArr = [], cookie = '', message = '';
|
||||
const inviteCodes = ['V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=', 'PDPM257r_KuQhil2Y7koNw==', "gB99tYLjvPcEFloDgamoBw==", '-OvElMzqeyeGBWazWYjI1Q==', 'GFwo6PntxDHH95ZRzZ5uAg=='];
|
||||
const inviteCodes = ['V5LkjP4WRyjeCKR9VRwcRX0bBuTz7MEK0-E99EJ7u0k=@0WtCMPNq7jekehT6d3AbFw==', 'PDPM257r_KuQhil2Y7koNw==', "gB99tYLjvPcEFloDgamoBw==", '-OvElMzqeyeGBWazWYjI1Q==', 'GFwo6PntxDHH95ZRzZ5uAg=='];
|
||||
const jdCookieNode = $.isNode() ? require('./jdCookie.js') : '';
|
||||
if ($.isNode()) {
|
||||
Object.keys(jdCookieNode).forEach((item) => {
|
||||
@@ -1305,7 +1305,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
45
jd_fruit.js
45
jd_fruit.js
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
东东水果:脚本更新地址 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_fruit.js
|
||||
更新时间:2020-12-25
|
||||
更新时间:2021-1-5
|
||||
东东农场活动链接:https://h5.m.jd.com/babelDiy/Zeus/3KSjXqQabiTuD1cJ28QskrpWoBKT/index.html
|
||||
已支持IOS双京东账号,Node.js支持N个京东账号
|
||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||
@@ -29,9 +29,9 @@ let cookiesArr = [], cookie = '', jdFruitShareArr = [], isBox = false, notify, n
|
||||
//下面给出两个账号的填写示例(iOS只支持2个京东账号)
|
||||
let shareCodes = [ // 这个列表填入你要助力的好友的shareCode
|
||||
//账号一的好友shareCode,不同好友的shareCode中间用@符号隔开
|
||||
'0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a',
|
||||
'0a74407df5df4fa99672a037eec61f7e@dbb21614667246fabcfd9685b6f448f3@6fbd26cc27ac44d6a7fed34092453f77@61ff5c624949454aa88561f2cd721bf6@56db8e7bc5874668ba7d5195230d067a@',
|
||||
//账号二的好友shareCode,不同好友的shareCode中间用@符号隔开
|
||||
'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3',
|
||||
'b1638a774d054a05a30a17d3b4d364b8@f92cb56c6a1349f5a35f0372aa041ea0@9c52670d52ad4e1a812f894563c746ea@8175509d82504e96828afc8b1bbb9cb3@2673c3777d4443829b2a635059953a28',
|
||||
]
|
||||
let message = '', subTitle = '', option = {}, isFruitFinished = false;
|
||||
const retainWater = 100;//保留水滴大于多少g,默认100g;
|
||||
@@ -771,24 +771,31 @@ async function clockInIn() {
|
||||
//
|
||||
async function getAwardInviteFriend() {
|
||||
await friendListInitForFarm();//查询好友列表
|
||||
console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`);
|
||||
console.log(`开始删除${$.friendList.friends.length}个好友,可拿每天的邀请奖励`);
|
||||
for (let friend of $.friendList.friends) {
|
||||
console.log(`\n开始删除好友 [${friend.shareCode}]`);
|
||||
const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 });
|
||||
if (deleteFriendForFarm && deleteFriendForFarm.code === '0') {
|
||||
console.log(`删除好友 [${friend.shareCode}] 成功\n`);
|
||||
console.log(`查询好友列表数据:${JSON.stringify($.friendList)}\n`)
|
||||
if ($.friendList) {
|
||||
console.log(`\n今日已邀请好友${$.friendList.inviteFriendCount}个 / 每日邀请上限${$.friendList.inviteFriendMax}个`);
|
||||
console.log(`开始删除${$.friendList.friends && $.friendList.friends.length}个好友,可拿每天的邀请奖励`);
|
||||
if ($.friendList.friends && $.friendList.friends.length > 0) {
|
||||
for (let friend of $.friendList.friends) {
|
||||
console.log(`\n开始删除好友 [${friend.shareCode}]`);
|
||||
const deleteFriendForFarm = await request('deleteFriendForFarm', { "shareCode": `${friend.shareCode}`,"version":8,"channel":1 });
|
||||
if (deleteFriendForFarm && deleteFriendForFarm.code === '0') {
|
||||
console.log(`删除好友 [${friend.shareCode}] 成功\n`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友
|
||||
if ($.friendList.inviteFriendCount > 0) {
|
||||
if ($.friendList.inviteFriendCount > $.friendList.inviteFriendGotAwardCount) {
|
||||
console.log('开始领取邀请好友的奖励');
|
||||
await awardInviteFriendForFarm();
|
||||
console.log(`领取邀请好友的奖励结果::${JSON.stringify($.awardInviteFriendRes)}`);
|
||||
await receiveFriendInvite();//为他人助力,接受邀请成为别人的好友
|
||||
if ($.friendList.inviteFriendCount > 0) {
|
||||
if ($.friendList.inviteFriendCount > $.friendList.inviteFriendGotAwardCount) {
|
||||
console.log('开始领取邀请好友的奖励');
|
||||
await awardInviteFriendForFarm();
|
||||
console.log(`领取邀请好友的奖励结果::${JSON.stringify($.awardInviteFriendRes)}`);
|
||||
}
|
||||
} else {
|
||||
console.log('今日未邀请过好友')
|
||||
}
|
||||
} else {
|
||||
console.log('今日未邀请过好友')
|
||||
console.log(`查询好友列表失败\n`);
|
||||
}
|
||||
}
|
||||
//给好友浇水
|
||||
@@ -1239,7 +1246,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面`)
|
||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
665
jd_get_share_code.js
Normal file
665
jd_get_share_code.js
Normal file
File diff suppressed because one or more lines are too long
@@ -265,7 +265,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,8 +108,8 @@ function showMsg() {
|
||||
} else {
|
||||
$.log(`京东账号${$.index}${$.nickName}\n${message}`);
|
||||
}
|
||||
if (new Date().getHours() === 23) {
|
||||
$.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}`);
|
||||
if (new Date().getHours() === 12) {
|
||||
$.msg($.name, '', `${message}`);
|
||||
}
|
||||
resolve()
|
||||
})
|
||||
@@ -181,6 +181,7 @@ async function algorithm() {
|
||||
}
|
||||
} else {
|
||||
console.log(`\n此账号${$.index}${$.nickName}暂未选择商品\n`);
|
||||
message += `京东账号${$.index} ${$.nickName}\n`;
|
||||
message += `已选商品:暂无\n`;
|
||||
message += `心仪商品:${wantProduct ? wantProduct : '暂无'}\n`;
|
||||
if (wantProduct) {
|
||||
@@ -216,17 +217,17 @@ async function algorithm() {
|
||||
} else {
|
||||
console.log(`BoxJs或环境变量暂未提供心仪商品\n如需兑换心仪商品,请提供心仪商品名称\n`);
|
||||
await jdfactory_getProductList(true);
|
||||
message += `当前剩余最多商品:${$.canMakeList[0].name}\n`;
|
||||
message += `兑换所需电量:${$.canMakeList[0].fullScore}\n`;
|
||||
message += `当前剩余最多商品:${$.canMakeList[0] && $.canMakeList[0].name}\n`;
|
||||
message += `兑换所需电量:${$.canMakeList[0] && $.canMakeList[0].fullScore}\n`;
|
||||
message += `您当前总电量:${$.batteryValue * 1}\n`;
|
||||
if ($.canMakeList[0].couponCount > 0 && $.batteryValue * 1 >= $.canMakeList[0].fullScore) {
|
||||
if ($.canMakeList[0] && $.canMakeList[0].couponCount > 0 && $.batteryValue * 1 >= $.canMakeList[0] && $.canMakeList[0].fullScore) {
|
||||
let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000);
|
||||
if (new Date(nowTimes).getHours() === 12) {
|
||||
$.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}【满足】兑换${$.canMakeList[0].name}所需总电量:${$.canMakeList[0].fullScore}\n请点击弹窗直达活动页面\n选择此心仪商品并手动投入电量兑换`, {'open-url': 'openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/2uSsV2wHEkySvompfjB43nuKkcHp/index.html%22%20%7D'});
|
||||
if ($.isNode()) await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n${message}【满足】兑换${$.canMakeList[0].name}所需总电量:${$.canMakeList[0].fullScore}\n请速去活动页面查看`);
|
||||
$.msg($.name, '', `京东账号${$.index}${$.nickName}\n${message}【满足】兑换${$.canMakeList[0] && $.canMakeList[0] && [0].name}所需总电量:${$.canMakeList[0] && $.canMakeList[0].fullScore}\n请点击弹窗直达活动页面\n选择此心仪商品并手动投入电量兑换`, {'open-url': 'openjd://virtual?params=%7B%20%22category%22:%20%22jump%22,%20%22des%22:%20%22m%22,%20%22url%22:%20%22https://h5.m.jd.com/babelDiy/Zeus/2uSsV2wHEkySvompfjB43nuKkcHp/index.html%22%20%7D'});
|
||||
if ($.isNode()) await notify.sendNotify(`${$.name} - 账号${$.index} - ${$.nickName}`, `【京东账号${$.index}】${$.nickName}\n${message}【满足】兑换${$.canMakeList[0] && $.canMakeList[0].name}所需总电量:${$.canMakeList[0].fullScore}\n请速去活动页面查看`);
|
||||
}
|
||||
} else {
|
||||
console.log(`\n目前电量${$.batteryValue * 1},不满足兑换 ${$.canMakeList[0].name}所需的 ${$.canMakeList[0].fullScore}电量\n`)
|
||||
console.log(`\n目前电量${$.batteryValue * 1},不满足兑换 ${$.canMakeList[0] && $.canMakeList[0].name}所需的 ${$.canMakeList[0] && $.canMakeList[0].fullScore}电量\n`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -355,7 +356,8 @@ async function doTask() {
|
||||
|
||||
//领取做完任务的奖励
|
||||
function jdfactory_collectScore(taskToken) {
|
||||
return new Promise(resolve => {
|
||||
return new Promise(async resolve => {
|
||||
await $.wait(1000);
|
||||
$.post(taskPostUrl("jdfactory_collectScore", { taskToken }, "jdfactory_collectScore"), async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@@ -534,17 +536,20 @@ function jdfactory_getProductList(flag = false) {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
if (data.data.bizCode === 0) {
|
||||
$.canMakeList = [];
|
||||
$.canMakeList = data.data.result.canMakeList;//当前可选商品列表 sellOut:1为已抢光,0为目前可选择
|
||||
$.canMakeList.sort(sortCouponCount);
|
||||
console.log(`商品名称 可选状态 剩余量`)
|
||||
for (let item of $.canMakeList) {
|
||||
console.log(`${item.name.slice(-4)} ${item.sellOut === 1 ? '已抢光':'可 选'} ${item.couponCount}`);
|
||||
}
|
||||
if (!flag) {
|
||||
if ($.canMakeList && $.canMakeList.length > 0) {
|
||||
$.canMakeList.sort(sortCouponCount);
|
||||
console.log(`商品名称 可选状态 剩余量`)
|
||||
for (let item of $.canMakeList) {
|
||||
if (item.name.indexOf(wantProduct) > -1 && item.couponCount > 0 && item.sellOut === 0) {
|
||||
await jdfactory_makeProduct(item.skuId);
|
||||
break
|
||||
console.log(`${item.name.slice(-4)} ${item.sellOut === 1 ? '已抢光':'可 选'} ${item.couponCount}`);
|
||||
}
|
||||
if (!flag) {
|
||||
for (let item of $.canMakeList) {
|
||||
if (item.name.indexOf(wantProduct) > -1 && item.couponCount > 0 && item.sellOut === 0) {
|
||||
await jdfactory_makeProduct(item.skuId);
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -623,7 +628,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面`)
|
||||
console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ const JD_API_HOST = 'https://jdjoy.jd.com';
|
||||
}
|
||||
continue
|
||||
}
|
||||
console.log(`本地时间与京东服务器时间差(毫秒):${await get_diff_time()}`);
|
||||
await joyReward();
|
||||
// $.msg($.name, '兑换脚本暂不能使用', `请停止使用,等待后期更新\n如果新版本兑换您有兑换机会,请抓包兑换\n再把抓包数据发送telegram用户@lxk0301`);
|
||||
}
|
||||
@@ -273,6 +274,35 @@ function TotalBean() {
|
||||
})
|
||||
})
|
||||
}
|
||||
function getJDServerTime() {
|
||||
return new Promise(resolve => {
|
||||
// console.log(Date.now())
|
||||
$.get({url: "https://a.jd.com//ajax/queryServerData.html",headers:{
|
||||
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1 Edg/87.0.4280.88"
|
||||
}}, async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
console.log(`${JSON.stringify(err)}`)
|
||||
console.log(`${$.name} 获取京东服务器时间失败,请检查网路重试`)
|
||||
} else {
|
||||
data = JSON.parse(data);
|
||||
$.jdTime = data['serverTime'];
|
||||
// console.log(data['serverTime']);
|
||||
// console.log(data['serverTime'] - Date.now())
|
||||
}
|
||||
} catch (e) {
|
||||
$.logErr(e, resp)
|
||||
} finally {
|
||||
resolve($.jdTime);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
async function get_diff_time() {
|
||||
// console.log(`本机时间戳 ${Date.now()}`)
|
||||
// console.log(`京东服务器时间戳 ${await getJDServerTime()}`)
|
||||
return Date.now() - await getJDServerTime();
|
||||
}
|
||||
function jsonParse(str) {
|
||||
if (typeof str == "string") {
|
||||
try {
|
||||
|
||||
@@ -442,7 +442,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面`)
|
||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
种豆得豆 脚本更新地址:https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_plantBean.js
|
||||
更新时间:2020-11-04
|
||||
更新时间:2020-12-31
|
||||
已支持IOS京东双账号,云端N个京东账号
|
||||
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
|
||||
注:会自动关注任务中的店铺跟商品,介意者勿使用。
|
||||
@@ -161,14 +161,27 @@ async function stealFriendWater() {
|
||||
return
|
||||
}
|
||||
if ($.stealFriendList.data && $.stealFriendList.data.friendInfoList && $.stealFriendList.data.friendInfoList.length > 0) {
|
||||
let nowTimes = new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000 + 8*60*60*1000);
|
||||
for (let item of $.stealFriendList.data.friendInfoList) {
|
||||
if (item.nutrCount >= 3) {
|
||||
// console.log(`可以偷的好友的信息::${JSON.stringify(item)}`);
|
||||
console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`);
|
||||
await collectUserNutr(item.paradiseUuid);
|
||||
console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`)
|
||||
if ($.stealFriendRes.code === '0') {
|
||||
console.log(`偷取好友营养液成功`)
|
||||
if (new Date(nowTimes).getHours() === 20) {
|
||||
if (item.nutrCount >= 2) {
|
||||
// console.log(`可以偷的好友的信息::${JSON.stringify(item)}`);
|
||||
console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`);
|
||||
await collectUserNutr(item.paradiseUuid);
|
||||
console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`)
|
||||
if ($.stealFriendRes.code === '0') {
|
||||
console.log(`偷取好友营养液成功`)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (item.nutrCount >= 3) {
|
||||
// console.log(`可以偷的好友的信息::${JSON.stringify(item)}`);
|
||||
console.log(`可以偷的好友的信息paradiseUuid::${JSON.stringify(item.paradiseUuid)}`);
|
||||
await collectUserNutr(item.paradiseUuid);
|
||||
console.log(`偷取好友营养液情况:${JSON.stringify($.stealFriendRes)}`)
|
||||
if ($.stealFriendRes.code === '0') {
|
||||
console.log(`偷取好友营养液成功`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -508,7 +521,7 @@ function readShareCode() {
|
||||
console.log(`${$.name} API请求失败,请检查网路重试`)
|
||||
} else {
|
||||
if (data) {
|
||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面`)
|
||||
console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: lxk0301 https://github.com/lxk0301
|
||||
* @Date: 2020-11-12 11:42:12
|
||||
* @Last Modified by: lxk0301
|
||||
* @Last Modified time: 2020-12-23 14:27:20
|
||||
* @Last Modified time: 2021-1-4 14:27:20
|
||||
*/
|
||||
/*
|
||||
东东小窝 https://raw.githubusercontent.com/lxk0301/jd_scripts/master/jd_small_home.js
|
||||
@@ -274,25 +274,27 @@ function queryFurnituresCenterList() {
|
||||
if (safeGet(data)) {
|
||||
data = JSON.parse(data);
|
||||
if (data.head.code === 200) {
|
||||
let { buy, list } = data.body;
|
||||
$.canBuyList = [];
|
||||
list.map((item, index) => {
|
||||
if (buy.some((buyItem) => buyItem === item.id)) return
|
||||
$.canBuyList.push(item);
|
||||
})
|
||||
$.canBuyList.sort(sortByjdBeanNum);
|
||||
if ($.canBuyList[0].needWoB <= $.woB) {
|
||||
await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum);
|
||||
} else {
|
||||
console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`)
|
||||
message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`;
|
||||
if (data.body) {
|
||||
let { buy, list } = data.body;
|
||||
$.canBuyList = [];
|
||||
list.map((item, index) => {
|
||||
if (buy.some((buyItem) => buyItem === item.id)) return
|
||||
$.canBuyList.push(item);
|
||||
})
|
||||
$.canBuyList.sort(sortByjdBeanNum);
|
||||
if ($.canBuyList[0].needWoB <= $.woB) {
|
||||
await furnituresCenterPurchase($.canBuyList[0].id, $.canBuyList[0].jdBeanNum);
|
||||
} else {
|
||||
console.log(`\n兑换${$.canBuyList[0].jdBeanNum}京豆失败:当前wo币${$.woB}不够兑换所需的${$.canBuyList[0].needWoB}WO币`)
|
||||
message += `【装饰领京豆】兑换${$.canBuyList[0].jdBeanNum}京豆失败,原因:WO币不够\n`;
|
||||
}
|
||||
// for (let canBuyItem of $.canBuyList) {
|
||||
// if (canBuyItem.needWoB <= $.woB) {
|
||||
// await furnituresCenterPurchase(canBuyItem.id, canBuyItem.jdBeanNum);
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// for (let canBuyItem of $.canBuyList) {
|
||||
// if (canBuyItem.needWoB <= $.woB) {
|
||||
// await furnituresCenterPurchase(canBuyItem.id, canBuyItem.jdBeanNum);
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: lxk0301 https://github.com/lxk0301
|
||||
* @Date: 2020-11-27 09:19:21
|
||||
* @Last Modified by: lxk0301
|
||||
* @Last Modified time: 2020-11-27 09:58:02
|
||||
* @Last Modified time: 2021-1-1 16:58:02
|
||||
*/
|
||||
/*
|
||||
十元街脚本,一周签到下来可获得30京豆,一天任意时刻运行一次即可
|
||||
@@ -93,7 +93,7 @@ function showMsg() {
|
||||
let signFlag = 0;
|
||||
function userSignIn() {
|
||||
return new Promise(resolve => {
|
||||
const body = {"activityId":"8d6845fe2e77425c82d5078d314d33c5","inviterId":"VMIQlLQqjQyjZokQmv5bIDgq011L0Ov8","channel":"MiniProgram"};
|
||||
const body = {"activityId":"ccd8067defcd4787871b7f0c96fcbf5c","inviterId":"","channel":"MiniProgram"};
|
||||
$.get(taskUrl('userSignIn', body), async (err, resp, data) => {
|
||||
try {
|
||||
if (err) {
|
||||
@@ -122,6 +122,10 @@ function userSignIn() {
|
||||
signFlag ++;
|
||||
await userSignIn();
|
||||
}
|
||||
} else if (data.code === 66) {
|
||||
//此处有时会遇到 服务器繁忙 导致签到失败,故重复三次签到
|
||||
$.log(`${$.name}签到失败:${data.msg}`);
|
||||
message += `【签到】失败,${data.msg}`;
|
||||
} else {
|
||||
console.log(`异常:${JSON.stringify(data)}`)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: lxk0301 https://github.com/lxk0301
|
||||
* @Date: 2020-08-19 16:12:40
|
||||
* @Last Modified by: lxk0301
|
||||
* @Last Modified time: 2020-12-21 13:52:54
|
||||
* @Last Modified time: 2021-1-5 17:52:54
|
||||
*/
|
||||
const querystring = require("querystring");
|
||||
const $ = new Env();
|
||||
@@ -49,7 +49,7 @@ let DD_BOT_SECRET = '';
|
||||
let QYWX_KEY = '';
|
||||
|
||||
// =======================================企业微信应用消息通知设置区域===========================================
|
||||
//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001
|
||||
//此处填你企业微信应用消息的 值(详见文档 https://work.weixin.qq.com/api/doc/90000/90135/90236),依次填上corpid的值,corpsecret的值,touser的值,agentid的值,素材库图片id(见https://github.com/lxk0301/jd_scripts/issues/519) 注意用,号隔开,例如:wwcff56746d9adwers,B-791548lnzXBE6_BWfxdf3kSTMJr9vFEPKAbh6WERQ,mingcheng,1000001,2COXgjH2UIfERF2zxrtUOKgQ9XklUqMdGSWLBoW_lSDAdafat
|
||||
//注:此处设置github action用户填写到Settings-Secrets里面(Name输入QYWX_AM)
|
||||
let QYWX_AM = '';
|
||||
|
||||
@@ -132,17 +132,21 @@ if (process.env.PUSH_PLUS_USER) {
|
||||
|
||||
async function sendNotify(text, desp, params = {}) {
|
||||
//提供7种通知
|
||||
await serverNotify(text, desp);//微信server酱
|
||||
await pushPlusNotify(text, desp);//pushplus(推送加)
|
||||
await Promise.all([
|
||||
serverNotify(text, desp),//微信server酱
|
||||
pushPlusNotify(text, desp)//pushplus(推送加)
|
||||
])
|
||||
//由于上述两种微信通知需点击进去才能查看到详情,故text(标题内容)携带了账号序号以及昵称信息,方便不点击也可知道是哪个京东哪个活动
|
||||
text = text.match(/.*?(?=\s?-)/g) ? text.match(/.*?(?=\s?-)/g)[0] : text;
|
||||
await BarkNotify(text, desp, params);//iOS Bark APP
|
||||
await tgBotNotify(text, desp);//telegram 机器人
|
||||
await ddBotNotify(text, desp);//钉钉机器人
|
||||
await qywxBotNotify(text, desp); //企业微信机器人
|
||||
await qywxamNotify(text, desp); //企业微信应用消息推送
|
||||
await iGotNotify(text, desp, params);//iGot
|
||||
await CoolPush(text, desp);//QQ酷推
|
||||
await Promise.all([
|
||||
BarkNotify(text, desp, params),//iOS Bark APP
|
||||
tgBotNotify(text, desp),//telegram 机器人
|
||||
ddBotNotify(text, desp),//钉钉机器人
|
||||
qywxBotNotify(text, desp), //企业微信机器人
|
||||
qywxamNotify(text, desp), //企业微信应用消息推送
|
||||
iGotNotify(text, desp, params),//iGot
|
||||
CoolPush(text, desp)//QQ酷推
|
||||
])
|
||||
}
|
||||
|
||||
function serverNotify(text, desp, timeout = 2100) {
|
||||
@@ -430,7 +434,8 @@ function qywxamNotify(text, desp) {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
};
|
||||
$.post(options_accesstoken, (err, resp, data) => {
|
||||
$.post(options_accesstoken, (err, resp, data) => {
|
||||
html=desp.replace(/\n/g,"<br/>")
|
||||
var json = JSON.parse(data);
|
||||
accesstoken = json.access_token;
|
||||
const options = {
|
||||
@@ -438,12 +443,18 @@ function qywxamNotify(text, desp) {
|
||||
json: {
|
||||
touser:`${QYWX_AM_AY[2]}`,
|
||||
agentid:`${QYWX_AM_AY[3]}`,
|
||||
msgtype: 'textcard',
|
||||
textcard: {
|
||||
msgtype: 'mpnews',
|
||||
mpnews: {
|
||||
articles: [
|
||||
{
|
||||
title: `${text}`,
|
||||
description: `${desp}`,
|
||||
url: '127.0.0.1',
|
||||
btntxt: '更多'
|
||||
thumb_media_id: `${QYWX_AM_AY[4]}`,
|
||||
author : `智能助手` ,
|
||||
content_source_url: ``,
|
||||
content : `${html}`,
|
||||
digest: `${desp}`
|
||||
}
|
||||
]
|
||||
},
|
||||
safe:'0',
|
||||
},
|
||||
|
||||
@@ -46,12 +46,12 @@ inputs:
|
||||
cronExpression: "0 0 0-16/8,20 * * * *"
|
||||
enable: true
|
||||
argument: jd_joy_reward&jd_joy_steal&jd_necklace&jd_live
|
||||
- timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #注销京东会员卡 #京东抽奖机 #东东小窝 #秒杀红包雨 #健康抽奖机
|
||||
- timer: #京东全民开红包 #进店领豆 #取关京东店铺商品 #注销京东会员卡 #京东抽奖机 #东东小窝 #健康抽奖机
|
||||
parameters:
|
||||
name: redPacket_shop_unsubscribe_unbind_lotteryMachine_small_home_ms_redrain_health
|
||||
name: redPacket_shop_unsubscribe_unbind_lotteryMachine_small_home_health
|
||||
cronExpression: "0 10 0 * * * *"
|
||||
enable: true
|
||||
argument: jd_redPacket&jd_shop&jd_unsubscribe&jd_unbind&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_health
|
||||
- timer: # 京东天天加速# 天天提鹅
|
||||
parameters:
|
||||
name: jd_speed_jd_daily_egg
|
||||
@@ -64,18 +64,18 @@ inputs:
|
||||
cronExpression: "0 15 * * * * *"
|
||||
enable: true
|
||||
argument: jd_superMarket
|
||||
- timer: #京豆变动通知 #疯狂的joy #京东排行榜 #领京豆额外奖励 #京东健康APP
|
||||
- timer: #京豆变动通知 #疯狂的joy #京东排行榜 #领京豆额外奖励
|
||||
parameters:
|
||||
name: bean_change_crazy_joy_rankingList_bean_home_jdh
|
||||
name: bean_change_crazy_joy_rankingList_bean_home
|
||||
cronExpression: "0 30 7 * * * *"
|
||||
enable: true
|
||||
argument: jd_bean_change&jd_crazy_joy&jd_rankingList&jd_bean_home&jd_car&jd_jdh
|
||||
- timer: #金融养猪 #十元街 #京东快递 #发现-看一看 #京东赚赚 #金融打卡领年终奖
|
||||
argument: jd_bean_change&jd_crazy_joy&jd_rankingList&jd_bean_home&jd_car
|
||||
- timer: #金融养猪 #十元街 #京东快递 #京东赚赚
|
||||
parameters:
|
||||
name: pigPet_syj_kd_watch_jdzz_jr_sign
|
||||
name: pigPet_syj_kd_jdzz
|
||||
cronExpression: "0 3 1 * * * *"
|
||||
enable: true
|
||||
argument: jd_pigPet&jd_syj&jd_kd&jd_watch&jd_jdzz&jr_sign
|
||||
argument: jd_pigPet&jd_syj&jd_kd&jd_jdzz
|
||||
environment: # 环境变量
|
||||
variables: # 环境变量对象
|
||||
AAA: BBB # 不要删除,用来格式化对齐追加的变量的
|
||||
|
||||
Reference in New Issue
Block a user