Skip to content

Instantly share code, notes, and snippets.

@z-------------
Last active August 29, 2015 13:56
Show Gist options
  • Save z-------------/9241689 to your computer and use it in GitHub Desktop.
Save z-------------/9241689 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, because I couldn't find a way to do this using selectors ;_;
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