Skip to content

Instantly share code, notes, and snippets.

@agentlame
Created July 16, 2013 23:37
Show Gist options
  • Save agentlame/6016247 to your computer and use it in GitHub Desktop.
Save agentlame/6016247 to your computer and use it in GitHub Desktop.
unmod queue filter
// ==UserScript==
// @name Reddit unmoderated filter
// @namespace redditunmoderated
// @description Some various changes to reddit
// @include http://www.reddit.com/r/mod/about/unmoderated*
// @include http://*.reddit.com/r/mod/about/unmoderated*
// @include http://reddit.com/r/mod/about/unmoderated*
// @version 1.0
// ==/UserScript==
function unmoderatedfilter() {
//
// Enter the subs below
//
var filtersubs=["technology", "atheism"];
if( location.pathname.match(/\/about\/(?:unmoderated)\/?/) ){
$('<li><a href="javascript:;" class="test-on">filter</a></li>').appendTo('#header ul:first').click(filter);
}
function filter(){
$('.thing').each(function() {
var subname = $(this).children('.entry').children('.tagline').children('a.subreddit').text();
if ($.inArray(subname, filtersubs) != -1) {
$(this).css('display', 'none');
}
});
}
}
// Add script to the page
document.addEventListener('DOMContentLoaded', function(e) {
var s = document.createElement('script');
s.textContent = "(" + unmoderatedfilter.toString() + ')();';
document.head.appendChild(s)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment