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

Function readShareCode

activity/jd_immortal.js:338–364  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

336}
337
338function readShareCode() {
339 console.log(`开始`)
340 return new Promise(async resolve => {
341 $.get({
342 url: `http://jd.turinglabs.net/api/v2/jd/immortal/read/${randomCount}/`,
343 'timeout': 10000
344 }, (err, resp, data) => {
345 try {
346 if (err) {
347 console.log(`${JSON.stringify(err)}`)
348 console.log(`${$.name} API请求失败,请检查网路重试`)
349 } else {
350 if (data) {
351 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
352 data = JSON.parse(data);
353 }
354 }
355 } catch (e) {
356 $.logErr(e, resp)
357 } finally {
358 resolve(data);
359 }
360 })
361 await $.wait(2000);
362 resolve()
363 })
364}
365
366//格式化助力码
367function shareCodesFormat() {

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