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

Function goods

tools/jd_cfd_SlotMachine.js:100–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98}
99
100function goods() {
101 return new Promise(resolve => {
102 let url = `https://m.jingxi.com/jxcfd/task/QueryAllConfig?strZone=jxcfd&bizCode=jxcfd&source=jxcfd&dwEnv=7&_cfd_t=${Date.now()}&ptag=138631.26.55&_stk=_cfd_t%2CbizCode%2CdwEnv%2Cptag%2Csource%2CstrZone&_ste=1&_=${Date.now()}&sceneval=2`
103 let h5st = decrypt(Date.now(), '_cfd_t,bizCode,dwEnv,ptag,source,strZone', '', url)
104 url += '&h5st=' + h5st
105 $.get({
106 url: url,
107 headers: {
108 'Host': 'm.jingxi.com',
109 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require(`${path}/USER_AGENTS`).USER_AGENT)) : ($.getdata('JDUA') ? $.getdata('JDUA') : "jdapp;iPhone;9.4.4;14.3;network/4g;Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1"),
110 'accept-language': 'zh-cn',
111 'referer': 'https://st.jingxi.com/',
112 'cookie': cookie
113 }
114 }, async (err, resp, data) => {
115 try {
116 console.log()
117 let temp = JSON.parse(fs.readFileSync('cfd.json', 'utf-8'))
118 let len = temp.length
119 data = JSON.parse(data)
120 for (let j of data.sData.exchangeCfg[0].materialData) {
121 if (j.levelstatus) {
122 console.log(j.name)
123 if (!temp.includes(j.name)) {
124 console.log('add:', j.name)
125 temp.push(j.name)
126 message += j.name + '\n'
127 }
128 }
129 }
130 if (temp.length !== len) {
131 writeFile(JSON.stringify(temp), 'cfd.json')
132 }
133 } catch (e) {
134 console.log(e)
135 } finally {
136 resolve()
137 }
138 })
139 })
140}
141
142function TotalBean() {
143 return new Promise(async resolve => {

Callers 1

Calls 6

decryptFunction · 0.70
writeFileFunction · 0.70
getMethod · 0.45
isNodeMethod · 0.45
getdataMethod · 0.45
logMethod · 0.45

Tested by

no test coverage detected