Last active
August 29, 2015 14:17
-
-
Save ginoclement/3efffe1cb6d1015865fd to your computer and use it in GitHub Desktop.
Remove any Facebook posts with a hashtag
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
/* | |
Remove any Facebook posts that contain hashtags. | |
Only reason for this was to see how easy it would be. | |
Facebook does not use jQuery so it would have to be loaded. | |
*/ | |
//Pure Javascript | |
function removeHashtags(){ | |
temp = document.getElementsByClassName("_58cl"); | |
for(var i = 0; i < temp.length; i++){ | |
temp[i].parentNode.parentNode.parentNode.parentNode.parentNode.remove(); | |
}; | |
}; | |
removeHashtags(); | |
window.onscroll=removeHashtags; | |
//With jQuery | |
function removeHashtags(){ | |
$.each($("._58cl"), function(k, v){ | |
$(v).parents("._4-u2.mbm._5jmm._5pat._5v3q").remove(); | |
}); | |
} | |
removeHashtags(); | |
$(document).on('DOMNodeInserted', removeHashtags); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment