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

Function readShareCode

activity/jd_5g.js:551–577  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

549 })
550}
551function readShareCode() {
552 console.log(`开始`)
553 return new Promise(async resolve => {
554 $.get({
555 url: `http://jd.turinglabs.net/api/v2/jd/5g/read/${randomCount}/`,
556 'timeout': 10000
557 }, (err, resp, data) => {
558 try {
559 if (err) {
560 console.log(`${JSON.stringify(err)}`)
561 console.log(`${$.name} API请求失败,请检查网路重试`)
562 } else {
563 if (data) {
564 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
565 data = JSON.parse(data);
566 }
567 }
568 } catch (e) {
569 $.logErr(e, resp)
570 } finally {
571 resolve(data);
572 }
573 })
574 await $.wait(2000);
575 resolve()
576 })
577}
578
579//格式化助力码
580function 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