MCPcopy Create free account
hub / github.com/Toulu-debug/enen / readShareCode

Function readShareCode

jd_pet.js:490–512  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

488}
489
490function readShareCode() {
491 return new Promise(async resolve => {
492 $.get({url: `http://sharecodepool.cnmb.pw/api/pet/${randomCount}`, 'timeout': 10000}, (err, resp, data) => {
493 try {
494 if (err) {
495 console.log(`${JSON.stringify(err)}`)
496 console.log(`${$.name} API请求失败,请检查网路重试`)
497 } else {
498 if (data) {
499 console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
500 data = JSON.parse(data);
501 }
502 }
503 } catch (e) {
504 $.logErr(e, resp)
505 } finally {
506 resolve(data);
507 }
508 })
509 await $.wait(10000);
510 resolve()
511 })
512}
513
514function shareCodesFormat() {
515 return new Promise(async resolve => {

Callers 1

shareCodesFormatFunction · 0.70

Calls 4

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

Tested by

no test coverage detected