mirror of
https://github.com/fmz200/wool_scripts.git
synced 2025-12-19 13:41:18 +08:00
Initial commit: new history
This commit is contained in:
37
Scripts/ithome/ithome.js
Normal file
37
Scripts/ithome/ithome.js
Normal file
@ -0,0 +1,37 @@
|
||||
// 2023-08-21 10:25
|
||||
|
||||
/**
|
||||
[rewrite_local]
|
||||
^https:\/\/napi\.ithome\.com\/api\/(news\/index|topmenu\/getfeeds) url script-response-body https://raw.githubusercontent.com/fmz200/wool_scripts/main/Scripts/ithome/ithome.js
|
||||
|
||||
[mitm]
|
||||
hostname = napi.ithome.com
|
||||
*/
|
||||
|
||||
const url = $request.url;
|
||||
if (!$response.body) $done({});
|
||||
let obj = JSON.parse($response.body);
|
||||
|
||||
if (
|
||||
url.includes("/api/news/index") ||
|
||||
url.includes("/api/topmenu/getfeeds")
|
||||
) {
|
||||
if (obj?.data?.list?.length > 0) {
|
||||
let list = obj.data.list;
|
||||
const newList = [];
|
||||
for (let item of list) {
|
||||
if (item?.feedContent?.smallTags?.some((i) =>
|
||||
i?.text?.includes("广告"))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if ([10002, 10003].includes(item?.feedType)) {
|
||||
continue;
|
||||
}
|
||||
newList.push(item);
|
||||
}
|
||||
obj.data.list = newList;
|
||||
}
|
||||
}
|
||||
|
||||
$done({ body: JSON.stringify(obj) });
|
||||
Reference in New Issue
Block a user