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

Function readShareCode

jd_cash.js:357–380  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

355 })
356}
357function readShareCode() {
358 console.log(`开始`)
359 return new Promise(async resolve => {
360 $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=cash&num=${randomCount}`, 'timeout': 10000}, (err, resp, data) => {
361 try {
362 if (err) {
363 console.log(`${JSON.stringify(err)}`)
364 console.log(`${$.name} API请求失败,请检查网路重试`)
365 } else {
366 if (data) {
367 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
368 data = JSON.parse(data);
369 }
370 }
371 } catch (e) {
372 $.logErr(e, resp)
373 } finally {
374 resolve(data);
375 }
376 })
377 await $.wait(10000);
378 resolve()
379 })
380}
381//提交互助码
382
383function submitCode() {

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