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

Function readShareCode

activity/jd_nian.js:1347–1373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1345}
1346
1347function readShareCode() {
1348 console.log(`开始`)
1349 return new Promise(async resolve => {
1350 $.get({
1351 url: `https://code.chiang.fun/api/v1/jd/jdnian/read/${randomCount}/`,
1352 'timeout': 10000
1353 }, (err, resp, data) => {
1354 try {
1355 if (err) {
1356 console.log(`${JSON.stringify(err)}`)
1357 console.log(`${$.name} API请求失败,请检查网路重试`)
1358 } else {
1359 if (data) {
1360 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
1361 data = JSON.parse(data);
1362 }
1363 }
1364 } catch (e) {
1365 $.logErr(e, resp)
1366 } finally {
1367 resolve(data);
1368 }
1369 })
1370 await $.wait(10000);
1371 resolve()
1372 })
1373}
1374
1375function readShareCodePk() {
1376 console.log(`开始`)

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