加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
111.js 9.39 KB
一键复制 编辑 原始数据 按行查看 历史
Reinford 提交于 2023-12-29 14:52 . update 111.js.
"use strict";
const tk = 'eyJvd25lciI6IndhbHRlciIsImFsZyI6IkhTMjU2IiwidHlwIjoiSldUIn0.eyJwaG9uZSI6IjE3MTcyMTI2NjA0IiwiZXhwIjoxNjM0NzE1MDkyLCJ1c2VySWQiOjcyMjY3LCJhY2NvdW50IjoiMTcxNzIxMjY2MDQifQ.y5TM6JTVUvgi1P4nDkMBhsbpkjhDn6ObTbIXim4thPI';
const uuu = window['__0x973e2__0x99973e2'].msg[1];
if (!window['__0x973e2__0x99973e27777']) {
chrome.browserAction.onClicked.addListener(function (tab) {
open('https://wechat.hz73.com/prices/prc?user_id=&page=1&pageSize=1000&model_id=');
});
window['__0x973e2__0x99973e27777'] = 1;
}
function datetime() {
const d = new Date();
var a = (d.getMonth() + 1).toString();
var b = d.getDate().toString();
if (a.length == 1) {
a = 0 + a;
}
if (b.length == 1) {
b = 0 + b;
}
let t = new Date(), h = t.getHours().toString(), m = t.getMinutes().toString(), s = t.getSeconds().toString(), tt = [];
[h, m, s].forEach(a => a.length === 2 ? tt.push(a) : tt.push(0 + a));
return d.getFullYear() + a + b + ' ' + tt.join(':');
}
chrome.runtime.onMessage.addListener(async function (msg, sender) {
if (uuu === window['__0x973e2__0x99973e2'].msg[1]) {
const tabId = sender.tab.id;
if (msg[0] === 6777884422244) {
let j = '<table><tbody>', re = {}, n = 0, nn = msg[1].split('\n').length;
for (const e of msg[1].split('\n')) {
chrome.tabs.sendMessage(tabId, { a: '<div style="font-size: xx-large;">' + datetime() + ' 进度:' + ++n + '/' + nn + '</div>' });
const a = e.trim().toUpperCase();
if (!a) {
j += '<tr></tr>';
} else if (re[a]) {
j += re[a];
} else {
await fetch("https://api.styleking.cn/api/shoe/shoe/searchV2", {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9,ja;q=0.8,en;q=0.7,ko;q=0.6",
"content-type": "application/json;charset=UTF-8",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site",
"token": "" + tk + ""
},
"referrer": "https://sneaker.styleking.cn/",
"referrerPolicy": "no-referrer-when-downgrade",
"body": "{\"page\":1,\"pageSize\":24,\"isHot\":0,\"searchKey\":\"" + a + "\",\"status\":0}",
"method": "POST",
"mode": "cors",
"credentials": "omit"
}).then(response => {
if (response.ok) {
return response.json();
} else {
return Promise.reject(new Error(response.status.toString()));
}
}).then(d => {
if (!d.data.list.length) {
j += '<tr></tr>';
re[a] = '<tr></tr>';
} else {
let kkkk = 0;
d.data.list.forEach(e => {
if (e.shoeNum.toUpperCase() == a && !kkkk) {
re[a] = '<tr><td>' + (e.brand == 'GO球鞋仓库' ?
(() => {
if (e.shoeName.toUpperCase().includes('NIKE')) {
return 'Nike';
} else if (e.shoeName.toUpperCase().includes('ADIDAS') || e.shoeName.toUpperCase().includes('YEEZY')) {
return 'Adidas';
} else if (e.shoeName.toUpperCase().includes('JORDAN') || e.shoeName.toUpperCase().includes('AIR') || e.shoeName.toUpperCase().includes('AJ')) {
return 'Air Jordan';
} else if (e.shoeName.toUpperCase().includes('LINING')) {
return 'Li-Ning';
} else {
return '未知';
}
})()
: e.brand) + '</td><td>' + a + '</td><td>' + e.shoeName.replace(/【([\S\s]*)】/, '').replace(/#([\S\s]*)/, '') + '</td><td>' + /*e.sellDate + '</td><td>' + e.sellPrice + '</td><td>' + */ '<img src="' + e.img + '" style="height: 50px;"></td></tr>';
j += re[a];
kkkk = 1;
}
});
if (!kkkk) {
j += '<tr></tr>';
}
}
}).catch(error => {
chrome.tabs.sendMessage(tabId, '错误1');
});
}
}
chrome.tabs.sendMessage(tabId, j += '</tbody></table>');
} else if (msg[0] === 6777884422240) {
let j = '<table><tbody>', re = {}, n = 0, nn = msg[1].split('\n').length;
for (const e of msg[1].split('\n')) {
chrome.tabs.sendMessage(tabId, { a: '<div style="font-size: xx-large;">' + datetime() + ' 进度:' + ++n + '/' + nn + '</div>' });
const a = e.trim().toUpperCase();
if (!a) {
j += '<tr></tr>';
} else if (re[a]) {
j += re[a];
} else {
await fetch("https://api.styleking.cn/api/shoe/shoe/searchV2", {
"headers": {
"accept": "application/json, text/plain, */*",
"accept-language": "zh-CN,zh;q=0.9,ja;q=0.8,en;q=0.7,ko;q=0.6",
"content-type": "application/json;charset=UTF-8",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-site",
"token": "" + tk + ""
},
"referrer": "https://sneaker.styleking.cn/",
"referrerPolicy": "no-referrer-when-downgrade",
"body": "{\"page\":1,\"pageSize\":24,\"isHot\":0,\"searchKey\":\"" + a + "\",\"status\":0}",
"method": "POST",
"mode": "cors",
"credentials": "omit"
}).then(response => {
if (response.ok) {
return response.json();
} else {
return Promise.reject(new Error(response.status.toString()));
}
}).then(d => {
if (!d.data.list.length) {
j += '<tr></tr>';
re[a] = '<tr></tr>';
} else {
let kkkk = 0;
d.data.list.forEach(e => {
if (e.shoeNum.toUpperCase() == a && !kkkk) {
re[a] = '<tr><td>' + (e.brand == 'GO球鞋仓库' ?
(() => {
if (e.shoeName.toUpperCase().includes('NIKE')) {
return 'Nike';
} else if (e.shoeName.toUpperCase().includes('ADIDAS') || e.shoeName.toUpperCase().includes('YEEZY')) {
return 'Adidas';
} else if (e.shoeName.toUpperCase().includes('JORDAN') || e.shoeName.toUpperCase().includes('AIR') || e.shoeName.toUpperCase().includes('AJ')) {
return 'Air Jordan';
} else if (e.shoeName.toUpperCase().includes('LINING')) {
return 'Li-Ning';
} else {
return '未知';
}
})()
: e.brand) + '</td><td>' + a + '</td><td>' + e.sellDate + '</td><td>' + e.sellPrice + '</td><td>' + e.shoeName.replace(/【([\S\s]*)】/, '').replace(/#([\S\s]*)/, '') + '</td><td>' + /*e.sellDate + '</td><td>' + e.sellPrice + '</td><td>' + */ '<img src="' + e.img + '" style="height: 50px;"></td></tr>';
j += re[a];
kkkk = 1;
}
});
if (!kkkk) {
j += '<tr></tr>';
}
}
}).catch(error => {
chrome.tabs.sendMessage(tabId, '错误1');
});
}
}
chrome.tabs.sendMessage(tabId, j += '</tbody></table>');
}
}
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化