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

Function readShareCode

activity/jd_city.js:254–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

252 })
253}
254function readShareCode() {
255 console.log(`开始`)
256 return new Promise(async resolve => {
257 $.get({url: `http://share.turinglabs.net/api/v3/city/query/10/`, 'timeout': 10000}, (err, resp, data) => {
258 try {
259 if (err) {
260 console.log(`${JSON.stringify(err)}`)
261 console.log(`${$.name} API请求失败,请检查网路重试`)
262 } else {
263 if (data) {
264 data = JSON.parse(data);
265 }
266 }
267 } catch (e) {
268 $.logErr(e, resp)
269 } finally {
270 resolve(data);
271 }
272 })
273 await $.wait(10000);
274 resolve()
275 })
276}
277//格式化助力码
278function shareCodesFormat() {
279 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