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

Function readShareCode

activity/jd_nian_ar.js:340–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

338 })
339}
340function readShareCode() {
341 console.log(`开始`)
342 return new Promise(async resolve => {
343 $.get({url: `https://code.chiang.fun/api/v1/jd/jdnian/read/${randomCount}/`, 'timeout': 10000}, (err, resp, data) => {
344 try {
345 if (err) {
346 console.log(`${JSON.stringify(err)}`)
347 console.log(`${$.name} API请求失败,请检查网路重试`)
348 } else {
349 if (data) {
350 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
351 data = JSON.parse(data);
352 }
353 }
354 } catch (e) {
355 $.logErr(e, resp)
356 } finally {
357 resolve(data);
358 }
359 })
360 await $.wait(2000);
361 resolve()
362 })
363}
364//格式化助力码
365function shareCodesFormat() {
366 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