Last active
August 29, 2015 13:56
-
-
Save z-------------/9241689 to your computer and use it in GitHub Desktop.
JavaScript for poking your Facebook friends back
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
// 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