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

Function readShareCode

jd_dreamFactory.js:1315–1338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1313 })
1314}
1315function readShareCode() {
1316 console.log(`开始`)
1317 return new Promise(async resolve => {
1318 $.get({url: `http://www.helpu.cf/jdcodes/getcode.php?type=jxfactory&num=${randomCount}`, 'timeout': 10000}, (err, resp, data) => {
1319 try {
1320 if (err) {
1321 console.log(`${JSON.stringify(err)}`)
1322 console.log(`${$.name} API请求失败,请检查网路重试`)
1323 } else {
1324 if (data) {
1325 console.log(`随机取${randomCount}个码放到您固定的互助码后面(不影响已有固定互助)`)
1326 data = JSON.parse(data);
1327 }
1328 }
1329 } catch (e) {
1330 $.logErr(e, resp)
1331 } finally {
1332 resolve(data);
1333 }
1334 })
1335 await $.wait(10000);
1336 resolve()
1337 })
1338}
1339//提交互助码
1340function submitCode() {
1341 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