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

Function readShareCode

jd_jdfactory.js:628–651  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

626 })
627}
628function readShareCode() {
629 console.log(`开始`)
630 return new Promise(async resolve => {
631 $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=ddfactory&num=${randomCount}`, timeout: 10000}, (err, resp, data) => {
632 try {
633 if (err) {
634 console.log(`${JSON.stringify(err)}`)
635 console.log(`${$.name} API请求失败,请检查网路重试`)
636 } else {
637 if (data) {
638 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
639 data = JSON.parse(data);
640 }
641 }
642 } catch (e) {
643 $.logErr(e, resp)
644 } finally {
645 resolve(data);
646 }
647 })
648 await $.wait(10000);
649 resolve()
650 })
651}
652//提交互助码
653function submitCode() {
654 return new Promise(async resolve => {

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