Something simple I slapped together recently. Entirely hides posts by specified users and optionally threads/topics created by them as well both on the board index pages and the Spy page.
Just needs one to manually add users by their user ID number (seen in the URL of their username link) in the script itself.
To install and configure:
- Install the Tampermonkey userscript manager addon (haven't tested in Greasemonkey but likely works with it too).
- Click the addon toolbar icon and select 'Create a new script'.
- Paste in the script embedded in this post and change or remove the ignored users seen at line 23, replacing '11111'/'22222' with the actual user ID number of the users to ignore (mine is '22672' for example). Note: always omit the comma after whatever the the last item is (or if it's the sole item), as seen in the examples.
- (Optional) Change 'hideThreads' to 'false' if you only want to hide posts.
- Click Tampermonkey's File>Save menu item or use Ctrl+S.
Reload a page on geekhack and bask in nothingness
Note: doesn't hide quoted posts. I thought about it but the way it currently hides posts entirely it might make some replies seem non-sensical/out of context. Perhaps it would work if semi-hidden in a quote to indicate/toggle an ignored post. Also would have hosted on Github but having an issue with it atm.
Userscript:
More
// ==UserScript==
// @name geekhack.org - Super Ignore
// @namespace Coreda
// @version 2020-04-05
// @description Hide user posts and optionally topics on geekhack even while logged out.
// @author Coreda
// @license MIT
// @match https://geekhack.org/index.php?topic=*
// @match https://geekhack.org/index.php?PHPSESSID=*&topic=*
// @match https://geekhack.org/index.php?board=*
// @match https://geekhack.org/index.php?action=recenttopics*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var hideThreads = true;
function qsa(sel, parent){ return Array.prototype.slice.call((parent || document).querySelectorAll(sel)); }
var ignoredUsers = [].concat(
qsa("a[href$='u=11111']"), // Example ID only
qsa("a[href$='u=22222']") // Example ID only
)
// Marginally less pre-hide flash than using a remove function
function hide(elem) {
elem.style.display = "none";
}
ignoredUsers.forEach(function(entry) {
// Check if page is forum post
if (window.location.href.indexOf("topic=") > -1) {
var parent = entry.parentNode.parentNode.parentNode.parentNode;
if (parent.classList.contains("windowbg") || parent.classList.contains("windowbg2")) {
hide(parent);
}
}
// Check if page is topic index
if (hideThreads == true && window.location.href.indexOf("board=") > -1) {
var parent = entry.parentNode.parentNode.parentNode.parentNode;
if (parent.nodeName.toLowerCase() == "tr") {
hide(parent);
}
}
// Check if page is Spy
if (hideThreads == true && window.location.href.indexOf("action=recenttopics") > -1) {
var parent = entry.parentNode.parentNode;
// Checks if username is contained in last table cell (to distinguish OP vs last poster)
if(!entry.parentNode.nextElementSibling) {
hide(parent);
}
}
});
})();