Skip to content

Commit

Permalink
搬运作者lxk0301签到领现金脚本,互助码环境变量自行添加
Browse files Browse the repository at this point in the history
  • Loading branch information
inoyna11 authored Jun 7, 2021
1 parent a9bcd36 commit 3a9f146
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions jd_cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
签到领现金,每日2毛~5毛
可互助,助力码每日不变,只变日期
活动入口:京东APP搜索领现金进入
更新时间:2021-04-28
更新时间:2021-06-07
已支持IOS双京东账号,Node.js支持N个京东账号
脚本兼容: QuantumultX, Surge, Loon, JSBox, Node.js
============Quantumultx===============
Expand Down Expand Up @@ -31,8 +31,8 @@ let helpAuthor = true;
const randomCount = $.isNode() ? 5 : 5;
let cash_exchange = false;//是否消耗2元红包兑换200京豆,默认否
const inviteCodes = [
``,
``
`eU9Ya-qzbv4i8muEynsThQ@eU9YL5XqGLxSmRSAkwxR@eU9YaO7jMvwh-W_VzyUX0Q@eU9YaurkY69zoj3UniVAgg@eU9YaOnjYK4j-GvWmXIWhA@eU9YMZ_gPpRurC-foglg@eU9Ya77gZK5z-TqHn3UWhQ@eU9Yaui2ZP4gpG-Gz3EThA@eU9YaeizbvQnpG_SznIS0w`,
`-4msulYas0O2JsRhE-2TA5XZmBQ@eU9Yar_mb_9z92_WmXNG0w@eU9YaO7jMvwh-W_VzyUX0Q@eU9YaurkY69zoj3UniVAgg@eU9YaOnjYK4j-GvWmXIWhA@eU9YaO23bvtyozuGyHsR1A`
]
if ($.isNode()) {
Object.keys(jdCookieNode).forEach((item) => {
Expand Down Expand Up @@ -85,6 +85,7 @@ let allMessage = '';
$.done();
})
async function jdCash() {
$.signMoney = 0;
await index()
await shareCodesFormat()
await helpFriends()
Expand All @@ -93,21 +94,25 @@ async function jdCash() {
$.exchangeBeanNum = 0;
cash_exchange = $.isNode() ? (process.env.CASH_EXCHANGE ? process.env.CASH_EXCHANGE : `${cash_exchange}`) : ($.getdata('cash_exchange') ? $.getdata('cash_exchange') : `${cash_exchange}`);
if (cash_exchange === 'true') {
console.log(`\n\n开始花费2元红包兑换200京豆,一周可换四次`)
for (let item of ["-1", "0", "1", "2", "3"]) {
$.canLoop = true;
if ($.canLoop) {
for (let i = 0; i < 5; i++) {
await exchange2(item);//兑换200京豆(2元红包换200京豆,一周5次。)
}
if (!$.canLoop) {
console.log(`已找到符合的兑换条件,跳出\n`);
break
if(Number($.signMoney) >= 2){
console.log(`\n\n开始花费2元红包兑换200京豆,一周可换五次`)
for (let item of ["-1", "0", "1", "2", "3"]) {
$.canLoop = true;
if ($.canLoop) {
for (let i = 0; i < 5; i++) {
await exchange2(item);//兑换200京豆(2元红包换200京豆,一周5次。)
}
if (!$.canLoop) {
console.log(`已找到符合的兑换条件,跳出\n`);
break
}
}
}
}
if ($.exchangeBeanNum) {
message += `兑换京豆成功,获得${$.exchangeBeanNum * 100}京豆\n`;
if ($.exchangeBeanNum) {
message += `兑换京豆成功,获得${$.exchangeBeanNum * 100}京豆\n`;
}
}else{
console.log(`\n\n现金不够2元,不进行兑换200京豆,`)
}
}
await index(true)
Expand All @@ -132,6 +137,7 @@ function index(info=false) {
console.log(`\n\n当前现金:${data.data.result.signMoney}元`);
return
}
$.signMoney = data.data.result.signMoney;
// console.log(`您的助力码为${data.data.result.inviteCode}`)
console.log(`\n【京东账号${$.index}${$.UserName})的${$.name}好友互助码】${data.data.result.inviteCode}\n`);
let helpInfo = {
Expand Down Expand Up @@ -346,7 +352,7 @@ function showMsg() {
function readShareCode() {
console.log(`开始`)
return new Promise(async resolve => {
$.get({url: `https://raw.githubusercontent.com/inoyna11/Write-files/master/shareCodes/jd_cash.json`, 'timeout': 10000}, (err, resp, data) => {
$.get({url: `https://code.chiang.fun/api/v1/jd/jdcash/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
try {
if (err) {
console.log(`${JSON.stringify(err)}`)
Expand Down Expand Up @@ -453,7 +459,7 @@ function taskUrl(functionId, body = {}) {
}
}

function getAuthorShareCode(url = "https://raw.githubusercontent.com/inoyna11/Write-files/master/shareCodes/jd_cash.json") {
function getAuthorShareCode(url = "http://cdn.annnibb.me/jd_cash.json") {
return new Promise(resolve => {
$.get({url, 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"
Expand All @@ -472,7 +478,7 @@ function getAuthorShareCode(url = "https://raw.githubusercontent.com/inoyna11/Wr
})
})
}
function getAuthorShareCode2(url = "https://raw.githubusercontent.com/inoyna11/Write-files/master/shareCodes/jd_cash.json") {
function getAuthorShareCode2(url = "https://cdn.jsdelivr.net/gh/gitupdate/updateTeam@master/shareCodes/jd_updateCash.json") {
return new Promise(resolve => {
$.get({url, 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"
Expand Down

0 comments on commit 3a9f146

Please sign in to comment.