MCPcopy Create free account
hub / github.com/Semporia/Scripts / readShareCode

Function readShareCode

activity/jd_newYearMoney.js:334–360  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

332}
333
334function readShareCode() {
335 console.log(`开始`)
336 return new Promise(async resolve => {
337 $.get({
338 url: `https://code.chiang.fun/api/v1/jd/year/read/${randomCount}/`,
339 'timeout': 10000
340 }, (err, resp, data) => {
341 try {
342 if (err) {
343 console.log(`${JSON.stringify(err)}`)
344 console.log(`${$.name} API请求失败,请检查网路重试`)
345 } else {
346 if (data) {
347 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
348 data = JSON.parse(data);
349 }
350 }
351 } catch (e) {
352 $.logErr(e, resp)
353 } finally {
354 resolve(data);
355 }
356 })
357 await $.wait(2000);
358 resolve()
359 })
360}
361function sendCard(cardNo) {
362 return new Promise((resolve) => {
363 $.post(taskPostUrl('newyearmoney_sendCard', {"cardNo": cardNo}), async (err, resp, data) => {

Callers 1

shareCodesFormatFunction · 0.70

Calls 4

logMethod · 0.45
getMethod · 0.45
logErrMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected