// ==UserScript==
// @name Topic and Post remover
// @namespace http://tampermonkey.net/
// @version 1
// @description Removes posts and topics if user ID of author/post author is in bannedUsers. You add more users by using this format = ["id","id","id"] etc.
// @author Ehmmkay
// @include
https://forums.d2jsp.org/topic.php*
// @include
https://forums.d2jsp.org/post.php// @include
https://forums.d2jsp.org/forum.php*
// @icon
https://www.google.com/s2/favicons?domain=d2jsp.org// @require
https://code.jquery.com/jquery-latest.js// @grant none
// ==/UserScript==
var bannedUsers = ["701571"];
function parsePosts() {
$('div.ppc').each(function () {
var userId = $(this).find('div.pU a').attr('href').split("=")[1];
if (bannedUsers.indexOf(userId) !== -1) {
this.remove();
}
});
}
function parseTopics() {
$('tr').each(function () {
if ($(this).find('td:nth-child(3) a').attr('href') && ~$(this).find('td:nth-child(3) a').attr('href').indexOf('user.php?i=')) {
var userId = $(this).find('td:nth-child(3) a').attr('href').split("=")[1];
if (bannedUsers.indexOf(userId) !== -1) {
this.remove();
}
}
});
}
parsePosts();
parseTopics();
this one better