1. Hey! Guest! The 31st GMC Jam will take place between Nov 16th, 12:00 UTC (Friday noon) and Nov 26th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

GMC Forums Prettify GMC: Filtering out status posts with Tampermonkey

Discussion in 'Community Chat' started by Tsa05, Aug 14, 2018.

  1. Tsa05

    Tsa05 Member

    Joined:
    Jun 21, 2016
    Posts:
    441
    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();
            });
        }
    })();
     
    Posh Indie likes this.
  2. Mercerenies

    Mercerenies Member

    Joined:
    Jun 21, 2016
    Posts:
    99
    Nocturne likes this.
  3. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    1,957
    That also hides the forum posts from the person, although one could argue that there isn't much lost for most of those that borderline abuse the profile update system.
     
  4. TsukaYuriko

    TsukaYuriko Q&A Spawn Camper Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    890
    That's Nocturne's line. :p

    Looking forward to the confused PMs of members who use this, forget about it and later are met with an empty status update section.
     
    Tsa05 and Nocturne like this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice