MCPcopy Create free account
hub / github.com/chavyleung/scripts / answer

Function answer

wanda/wanda.js:168–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

166
167// 答题
168function answer() {
169 return new Promise((resolve) => {
170 const answerVal = getKey()['key'] + '/question/qustion/answer.apiactivityCode='+$.questionCode+'&answer=%7b%221%22%3a%22'+escape(`${$.answer}`).toLowerCase()+'%22%7d'
171 mx_api['ts'] = getKey()['ts']
172 mx_api['check'] = hex_md5(answerVal)
173 const url = {
174 url:'https://activity-api-mx.wandafilm.com/question/qustion/answer.api',
175 headers:{
176 'MX-API':JSON.stringify(mx_api),
177 },
178 body : 'activityCode='+$.questionCode+'&answer=%7B%221%22%3A%22'+encodeURI(`${$.answer}`) + '%22%7D'
179 }
180 $.post(url, (err, resp, data) => {
181 try {
182 $.answer = JSON.parse(data)
183 } catch (e) {
184 $.logErr(e, resp)
185 } finally {
186 resolve()
187 }
188 })
189 })
190}
191
192// 答题后抽奖
193function drawprize_ans() {

Callers

nothing calls this directly

Calls 4

getKeyFunction · 0.85
hex_md5Function · 0.85
postMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected