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

Function getSgmh

jd_get_share_code.js:537–569  ·  view source on GitHub ↗
(timeout = 0)

Source from the content-addressed store, hash-verified

535}
536//闪购盲盒
537async function getSgmh(timeout = 0) {
538 return new Promise((resolve) => {
539 setTimeout( ()=>{
540 let url = {
541 url : `https://api.m.jd.com/client.action`,
542 headers : {
543 'Origin' : `https://h5.m.jd.com`,
544 'Cookie' : cookie,
545 'Connection' : `keep-alive`,
546 'Accept' : `application/json, text/plain, */*`,
547 'Referer' : `https://h5.m.jd.com/babelDiy/Zeus/2WBcKYkn8viyxv7MoKKgfzmu7Dss/index.html`,
548 'Host' : `api.m.jd.com`,
549 'Accept-Encoding' : `gzip, deflate, br`,
550 'Accept-Language' : `zh-cn`
551 },
552 body : `functionId=interact_template_getHomeData&body={"appId":"1EFRXxg","taskToken":""}&client=wh5&clientVersion=1.0.0`
553 }
554 $.post(url, async (err, resp, data) => {
555 try {
556 data = JSON.parse(data);
557 if (data.data.bizCode === 0) {
558 const invites = data.data.result.taskVos.filter(item => item['taskName'] === '邀请好友助力');
559 console.log(`【京东账号${$.index}(${$.UserName})闪购盲盒】${invites && invites[0]['assistTaskDetailVo']['taskToken']}`)
560 }
561 } catch (e) {
562 $.logErr(e, resp);
563 } finally {
564 resolve()
565 }
566 })
567 },timeout)
568 })
569}
570//财富岛
571function getCFD(showInvite = true) {
572 function taskUrl(function_path, body) {

Callers 1

getShareCodeFunction · 0.85

Calls 3

postMethod · 0.45
logMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected