MCPcopy Create free account
hub / github.com/Toulu-debug/enen / getShareCodePool

Function getShareCodePool

TS_USER_AGENTS.ts:195–211  ·  view source on GitHub ↗
(key: string, num: number)

Source from the content-addressed store, hash-verified

193}
194
195async function getShareCodePool(key: string, num: number) {
196 let shareCode: string[] = []
197 for (let i = 0; i < 2; i++) {
198 try {
199 let {data}: any = await axios.get(`http://sharecodepool.cnmb.pw/api/${key}/${num}`)
200 shareCode = data.data || []
201 console.log(`随机获取${num}个${key}成功:${JSON.stringify(shareCode)}`)
202 if (shareCode.length !== 0) {
203 break
204 }
205 } catch (e) {
206 console.log("getShareCodePool Error, Retry...")
207 await wait(getRandomNumberByRange(2000, 6000))
208 }
209 }
210 return shareCode
211}
212
213/*
214async function wechat_app_msg(title: string, content: string, user: string) {

Callers 1

jd_sgmh.tsFile · 0.90

Calls 4

waitFunction · 0.85
getRandomNumberByRangeFunction · 0.85
getMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected