Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Faker authored and Faker committed Oct 30, 2022
1 parent c664989 commit 309f17e
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jd_cxxb_award.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ if ($.isNode()) {
}
continue;
}
await run('promote_pk_getAmountForecast');
await $.wait(1000);
await run('promote_pk_receiveAward');
await $.wait(1000);
await run('promote_pk_divideScores');
Expand Down Expand Up @@ -74,23 +76,23 @@ function run(fn) {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
console.log(`promote_getWelfareScore 请求失败,请检查网路重试`)
console.log(`请求失败,请检查网路重试`)
} else {
if (safeGet(data)) {
data = JSON.parse(data);
if (data.code === 0) {
if (data.data && data.data.bizCode === 0) {
if (fn === 'promote_pk_receiveAward') {
console.log('领取组队红包:' + data.data.result.value);
} else {
} else if (fn === 'promote_pk_divideScores'){
console.log('领取组队金币:' + data.data.result.produceScore)
}
} else {
console.log(data.data.bizMsg);

}
} else {
console.log(`分享失败:${JSON.stringify(data)}\n`)
console.log(`失败:${JSON.stringify(data)}\n`)
resolve()
}
}
Expand Down
32 changes: 32 additions & 0 deletions jd_indeps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
#依赖安装,运行一次就好
#1 1 1 1 1 jd_indeps.sh
#new Env('依赖安装-手动运行');
#

npm_ver=`pnpm -v|awk -F. '{print $1}'`
if [[ $npm_ver -ge 7 ]];then
export PNPM_HOME="/root/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"
fi

echo -e "安装脚本所需依赖,不一定一次全部安装成功,请自己检查\n"
echo -e "开始安装............\n"

#apk add g++ make pixman-dev pango-dev cairo-dev pkgconf --no-cache
pnpm config set registry https://registry.npm.taobao.org
pnpm install -g png-js
pnpm install -g date-fns
pnpm install -g [email protected]
pnpm install -g crypto-js
pnpm install -g ts-md5
pnpm install -g tslib
pnpm install -g @types/node
pnpm install -g request
pnpm install -g jsdom
pnpm install -g moment
pnpm install -g tough-cookie
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ jieba
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ requests
rm -rf /usr/local/pnpm-global/5/node_modules/.pnpm/canvas*
echo -e "\n所需依赖安装完成,请检查有没有报错,可尝试再次运行"
22 changes: 22 additions & 0 deletions jd_txzj_collect_item.js

Large diffs are not rendered by default.

0 comments on commit 309f17e

Please sign in to comment.