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

Function unsubscribeGoodsFun

jd_unsubscribe.js:172–199  ·  view source on GitHub ↗
(commId)

Source from the content-addressed store, hash-verified

170}
171
172function unsubscribeGoodsFun(commId) {
173 return new Promise(resolve => {
174 const option = {
175 url: `${JD_API_HOST}/comm/FavCommDel?commId=${commId}&_=${Date.now()}&sceneval=2&g_login_type=1&callback=jsonpCBKP&g_ty=ls`,
176 headers: {
177 "Host": "wq.jd.com",
178 "Accept": "*/*",
179 "Connection": "keep-alive",
180 'User-Agent': $.isNode() ? (process.env.JD_USER_AGENT ? process.env.JD_USER_AGENT : (require('./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"),
181 'Referer': 'https://wqs.jd.com/my/fav/goods_fav.shtml?ptag=37146.4.1&sceneval=2&jxsid=15963530166144677970',
182 'Cookie': cookie,
183 "Accept-Language": "zh-cn",
184 "Accept-Encoding": "gzip, deflate, br"
185 },
186 }
187 $.get(option, (err, resp, data) => {
188 try {
189 data = JSON.parse(data.slice(14, -13).replace(',}', '}'));
190 // console.log('data', data);
191 // console.log('data', data.errMsg);
192 } catch (e) {
193 $.logErr(e, resp);
194 } finally {
195 resolve(data);
196 }
197 });
198 })
199}
200
201async function shopMain() {
202 $.unsubscribeShopsCount = 0;

Callers 1

unsubscribeGoodsFunction · 0.85

Calls 4

isNodeMethod · 0.45
getdataMethod · 0.45
getMethod · 0.45
logErrMethod · 0.45

Tested by

no test coverage detected