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

Function readShareCode

activity/jd_global.js:310–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308}
309
310function readShareCode() {
311 console.log(`开始`)
312 return new Promise(async resolve => {
313 $.get({
314 url: `http://jd.turinglabs.net/api/v2/jd/jdglobal/read/${randomCount}/`,
315 'timeout': 10000
316 }, (err, resp, data) => {
317 try {
318 if (err) {
319 console.log(`${JSON.stringify(err)}`)
320 console.log(`${$.name} API请求失败,请检查网路重试`)
321 } else {
322 if (data) {
323 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
324 data = JSON.parse(data);
325 }
326 }
327 } catch (e) {
328 $.logErr(e, resp)
329 } finally {
330 resolve(data);
331 }
332 })
333 await $.wait(10000);
334 resolve()
335 })
336}
337
338//格式化助力码
339function shareCodesFormat() {

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