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

Function readShareCode

jd_plantBean.js:541–563  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

539 $.plantBeanIndexResult = await request('plantBeanIndex');//plantBeanIndexBody
540}
541function readShareCode() {
542 return new Promise(async resolve => {
543 $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=bean&num=${randomCount}`, timeout: 10000}, (err, resp, data) => {
544 try {
545 if (err) {
546 console.log(`${JSON.stringify(err)}`)
547 console.log(`${$.name} API请求失败,请检查网路重试`)
548 } else {
549 if (data) {
550 console.log(`随机取个${randomCount}码放到您固定的互助码后面(不影响已有固定互助)`)
551 data = JSON.parse(data);
552 }
553 }
554 } catch (e) {
555 $.logErr(e, resp)
556 } finally {
557 resolve(data);
558 }
559 })
560 await $.wait(15000);
561 resolve()
562 })
563}
564//提交互助码
565function submitCode() {
566 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