Skip to content

Instantly share code, notes, and snippets.

@dvingerh
Last active November 25, 2017 19:21
Show Gist options
  • Save dvingerh/35bf25aadc1d19224931585952e47b85 to your computer and use it in GitHub Desktop.
Save dvingerh/35bf25aadc1d19224931585952e47b85 to your computer and use it in GitHub Desktop.
Because there's a lot of garbage on there. You can also set your own filters!
// ==UserScript==
// @name HF Unclutter bans.php page
// @namespace HF Unclutter bans.php page
// @version 0.4
// @description Because there's a lot of garbage on there. You can also set your own filters!
// @author Cammy
// @match *hackforums.net/bans.php
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
// ==/UserScript==
var filters = [
"violation earns an automatic 3-day ban.",
"vacation",
"https://hackforums.net/member.php?",
"spam"
];
var highlights = [
"close",
"come back",
"join"
];
$('tr').each(function() {
try
{
var trow = $(this).find(".trow2")[0];
for (var ii = 0, highlightLen = highlights.length; ii < highlightLen; ii++) {
if($(trow).html().toLowerCase().indexOf(highlights[ii].toLowerCase()) !== -1)
{
$(trow).css("background", "#403333").addClass("highlighted");
}
}
for (var i = 0, filterLen = filters.length; i < filterLen; i++) {
if($(trow).html().toLowerCase().indexOf(filters[i].toLowerCase()) !== -1 && $(trow).hasClass("highlighted") === false)
{
$(trow).parent().remove();
}
}
}
catch(err){}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment