Created
July 16, 2013 23:37
-
-
Save agentlame/6016247 to your computer and use it in GitHub Desktop.
unmod queue filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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