Skip to content

Instantly share code, notes, and snippets.

@glepur
Created August 3, 2014 16:06
Show Gist options
  • Select an option

  • Save glepur/4301b8068dd822b9d535 to your computer and use it in GitHub Desktop.

Select an option

Save glepur/4301b8068dd822b9d535 to your computer and use it in GitHub Desktop.
Facebook like spam - add to bookmark and press on facebook page to "like" everything
javascript: (function () {
var a = document.getElementsByTagName("a");
var content = document.getElementById("contentArea");
for(var i=0;i<a.length;i++){
if(a[i].innerHTML=="Like" && hasParent(a[i],content))
a[i].click();
}
function hasParent(child, parent) {
var node = child.parentNode;
while (node!=null) {
if (node==parent) {
return true;
}
node = node.parentNode;
}
return false;
}
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment