Skip to content

Instantly share code, notes, and snippets.

@bbhoss
Last active January 1, 2016 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbhoss/8108859 to your computer and use it in GitHub Desktop.
Save bbhoss/8108859 to your computer and use it in GitHub Desktop.
Automatically poke your friends back!
var autoPokerIndex = null;
var autoPoke = function() {
// LOL, do you even DOM bro?
document.evaluate('//*[text()="Poke Back"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE).snapshotItem(0).click();
}
var startAutoPoker = function() {
autoPokerIndex = setInterval(autoPoke, 2000);
}
var stopAutoPoker = function() {
if (autoPokerIndex) {
clearInterval(autoPokerIndex);
autoPokerIndex = null;
}
return !!autoPokerIndex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment