-
-
Save 4chenz/d92d5f974a26a9d6fd5c6adf91db3ca2 to your computer and use it in GitHub Desktop.
shows red ban box on most archives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 4bans @ archives | |
// @namespace Violentmonkey Scripts | |
// @include http://archive.4plebs.org/* | |
// @include https://archive.4plebs.org/* | |
// @include http://archive.nyafuu.org/* | |
// @include https://archive.nyafuu.org/* | |
// @include http://desuarchive.org/* | |
// @include https://desuarchive.org/* | |
// @include http://arch.b4k.co/* | |
// @include https://arch.b4k.co/* | |
// @include http://boards.fireden.net/* | |
// @include https://boards.fireden.net/* | |
// @include http://archived.moe/* | |
// @include https://archived.moe/* | |
// @include http://archiveofsins.com/* | |
// @include https://archiveofsins.com/* | |
// @include http://thebarchive.com/* | |
// @include https://thebarchive.com/* | |
// @include http://www.tokyochronos.net/* | |
// @include https://www.tokyochronos.net/* | |
// @include https://archive.wakarimasen.moe/* | |
// @include http://archive.wakarimasen.moe/* | |
// @include http://archive.alice.al/* | |
// @include https://archive.alice.al/* | |
// @include https://archive.palanq.win/* | |
// @include http://archive.palanq.win/* | |
// @grant GM.xmlHttpRequest | |
// @version 1.1 | |
// @author Anonymous | |
// @description 8/6/2022 | |
// ==/UserScript== | |
var articleDict = {}; | |
document.querySelectorAll('.icon-trash').forEach( | |
function(el) { | |
if (el != null) { | |
article = el.closest("article"); | |
articleDict[article.id] = article; | |
}} | |
) | |
function processBans(ban_arr){ | |
console.log(ban_arr.length, 'bans') | |
ban_arr.forEach((el) => { | |
if (articleDict[el.postnum].dataset.board === el.board.replaceAll('/','')){ | |
articleDict[el.postnum].querySelector('.text').insertAdjacentHTML('beforeend', `<a href="http://185.10.68.107:1776/bannum/${el.ban_id}/"> <div style="border-style: dashed; color:red;">${el.reason} - ${el.length}</div></a>`); | |
} | |
}); | |
} | |
if ( Object.keys(articleDict).join(",").length > 0 ){ | |
console.log("http://185.10.68.107:1776/many/"+Object.keys(articleDict).join(",")) | |
GM.xmlHttpRequest({ | |
method: "GET", | |
url: "http://185.10.68.107:1776/many/"+Object.keys(articleDict).join(","), | |
onload: function(response) { | |
processBans( JSON.parse(response.responseText) ); | |
} | |
}); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment