Created
November 11, 2014 05:34
-
-
Save craigpalermo/47ffa4700eda563a21ab to your computer and use it in GitHub Desktop.
Hide currently displayed Reddit posts that contain badWord in the title
This file contains hidden or 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
function dontShow(badWord) { | |
$(".thing").each(function(){ | |
var $parent = $(this); | |
var title = $parent.children(".entry").children(".title").children("a").html(); | |
if (title && title.indexOf(badWord) > 0) { | |
console.log(title); | |
$parent.hide(); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment