AimIsADick Blocker 9000

Hides AimIsADick posts on teamfortress.tv website

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         AimIsADick Blocker 9000
// @description     Hides AimIsADick posts on teamfortress.tv website
// @include      *://*teamfortress.tv/*
// @include      *://*tf.gg/*
// @version 0.0.1.20210320153402
// @namespace https://greasyfork.org/users/749376
// ==/UserScript==

(function() {
    'use strict';
    var thread_container = document.getElementById("thread-container");
    if(thread_container) {
        var post_array = thread_container.getElementsByClassName("post");
        var remove_posts = [];
        for (let post of post_array) {
            if(post.querySelector(".post-header .post-author").innerHTML.includes("AimIsADick")) {
                remove_posts.push(post);
            }
        }
        while(remove_posts.length > 0) {
            let post = remove_posts.shift();
            if (!post.querySelector(".post-header .post-frag-container .minus").className.includes("clicked")) {
                fetch('/post/frag/'+post.id.replace(/[^\d]*/g,'')+'/minus');
            }
            post.parentNode.removeChild(post);
        }
    }
})();