Skip to content

Instantly share code, notes, and snippets.

@Sacki2013
Forked from z-------------/pokeAll.js
Created February 27, 2014 00:25
Show Gist options
  • Select an option

  • Save Sacki2013/9241771 to your computer and use it in GitHub Desktop.

Select an option

Save Sacki2013/9241771 to your computer and use it in GitHub Desktop.
JavaScript for poking your Facebook friends back
// get poke buttons, including suggested pokes
var pokeButtons = document.querySelectorAll(".mls a._4jy0");
// exclude suggested pokes
var pokeBacks = [];
for(i=0;i<pokeButtons.length;i++){
if(pokeButtons[i].parentNode.parentNode.parentNode.parentNode.innerHTML.indexOf("Suggested Poke") == -1){
pokeBacks.push(pokeButtons[i])
}
}
// click all poke buttons
for(i=0;i<pokeBacks.length;i++){
pokeBacks[i].click()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment