Last active
January 1, 2016 06:59
-
-
Save bbhoss/8108859 to your computer and use it in GitHub Desktop.
Automatically poke your 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
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