Created
January 30, 2017 15:44
-
-
Save MrDOS/c27073349d9a914607a531e0b2d6860a to your computer and use it in GitHub Desktop.
Because clicking that “Poke Button” link yourself is just too damn hard.
This file contains hidden or 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 repoke = function() { | |
| var pokes = 0; | |
| Array.prototype.forEach.call( | |
| document.getElementsByTagName("img"), | |
| function(el) { | |
| if (el.className !== '_3-8_ img') | |
| return; | |
| var parent = el.parentNode; | |
| if (parent.innerHTML.indexOf("Poke Back") == -1) | |
| return; | |
| ++pokes; | |
| parent.click(); | |
| }); | |
| if (pokes == 1) { | |
| console.log("Responded to 1 poke."); | |
| } else { | |
| console.log("Responded to %d pokes.", pokes); | |
| } | |
| } | |
| window.setInterval(repoke, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment