Initial commit: new history

This commit is contained in:
king
2025-06-30 21:59:46 +08:00
commit cd32a8c7e5
1945 changed files with 111356 additions and 0 deletions

29
Scripts/reddit.js Normal file
View File

@ -0,0 +1,29 @@
/**
* @author fmz200
* @function Reddit过滤推广关NSFW提示
* @date 2024-01-2 17:01:00
* @quote xream
*/
let body;
try {
body = JSON.parse($response.body.replace(/"isNsfw":true/g, '"isNsfw":false'))
if (body.data?.children?.commentsPageAds) {
body.data.children.commentsPageAds = []
}
for (const [k, v] of Object.entries(body.data)) {
if (v?.elements?.edges) {
body.data[k].elements.edges = v.elements.edges.filter(
i =>
!['AdPost'].includes(i?.node?.__typename) &&
!i?.node?.cells?.some(j => j?.__typename === 'AdMetadataCell') &&
!i?.node?.adPayload
);
}
}
} catch (e) {
console.log(e);
} finally {
$done(body ? {body: JSON.stringify(body)} : {});
}