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

Function readShareCode

jd_pet.js:461–483  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

459 }
460}
461function readShareCode() {
462 return new Promise(async resolve => {
463 $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=pet&num=${randomCount}`, 'timeout': 10000}, (err, resp, data) => {
464 try {
465 if (err) {
466 console.log(`${JSON.stringify(err)}`)
467 console.log(`${$.name} readShareCode API请求失败,请检查网路重试`)
468 } else {
469 if (data) {
470 console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
471 data = JSON.parse(data);
472 }
473 }
474 } catch (e) {
475 $.logErr(e, resp)
476 } finally {
477 resolve(data);
478 }
479 })
480 await $.wait(10000);
481 resolve()
482 })
483}
484//提交互助码
485function submitCode() {
486 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