Created
November 13, 2013 19:04
-
-
Save atommarvel/7454481 to your computer and use it in GitHub Desktop.
Remove any post that contains the strings in strings2block. Initially it contains buzz, feed, and buzzfeed.
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
var posts = document.getElementsByClassName("userContent"); | |
var strings2block = ["buzz","feed","buzzfeed"] | |
var doesPostContainBlock = function(postContent, blockContent){ | |
for (y in blockContent){ | |
if(postContent.search(blockContent[y])>0) | |
return true; | |
} | |
return false; | |
} | |
for (x in posts){ | |
result = 0; | |
content = posts[x].innerHTML; | |
if(doesPostContainBlock(content,strings2block)) | |
posts[x].innerHTML = ""; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Instructions