GMC Forums Prettify GMC: Filtering out status posts with Tampermonkey

Tsa05

Member
Hi all,

Every so often, I realize I have an intolerant side to me, and that makes me sad.... But there's no group therapy sub-forum, so what's a frustrated forum-goer to do when feeling irrationally annoyed by any particular user posting constant streams of nonsense in the Status feed or the New Posts feed?

On a coding forum, there can be only one solution... Tampermonkey! Or, Greasemonkey.
For those not in the know about these arbitrary words:
Tamper/Greasemonkey are extensions/addons for Chrome/Firefox. In and of themselves, they do almost nothing--but they add a button to your browser bar that launches a dashboard where you can manage "user scripts." These are javascript snippets that you can write for yourself to modify the appearance or function of anything client-side on any web page you happen to visit. For example, you could write a javascript that locates all status posts by a certain person or persons and hides them.

If you're already set up with the appropriate plugin, here's a quick, simple script to hide items from the New Posts and the Status feeds whenever you land on the forum home. Just add usernames to the list in the script below and paste it into your monkey; in seconds, you'll be wondering where all the nuts around here have gone!

Code:
// ==UserScript==
// @name         Hide Undesireables
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Hide status/newpost <LI>
// @author       Tsa05
// @match        https://forum.yoyogames.com/index.php
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var list = ["username0", "username1"];
    var removalList = new Array;
    for(var i=0; i<list.length; i++){
        removalList.push($("li[data-author=\"" + list[i] + "\""));
    }
    for(var ii=0; ii<removalList.length; ii++){
        var node = removalList[ii];
        node.each(function(index, item){
            $(item).hide();
        });
    }
})();
 
Top