Skip to content

Instantly share code, notes, and snippets.

@ginoclement
Last active August 29, 2015 14:17
Show Gist options
  • Save ginoclement/3efffe1cb6d1015865fd to your computer and use it in GitHub Desktop.
Save ginoclement/3efffe1cb6d1015865fd to your computer and use it in GitHub Desktop.
Remove any Facebook posts with a hashtag
/*
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