Last active
August 29, 2015 14:06
-
-
Save xandris/67990d8631cfd25e1fe4 to your computer and use it in GitHub Desktop.
Facebook autopoker
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
(function(w,d){ | |
var x = function(n,p) { return d.createExpression(p).evaluate(n).iterateNext(); }; | |
w.pokeBack = function() { | |
pokeBack.id && window.clearTimeout(pokeBack.id); | |
delete pokeBack.id; | |
if(pokeBack.stopped) return; | |
var a = x(d,'//a[contains(@class, "_4jy1") and contains(.,"Poke Back")]'); | |
if(a && ! a.pokedBack) { | |
a.pokedBack = true; | |
var who = x(a,'../../following-sibling::*[1]//a').innerText; | |
a.click(); | |
console.log(who + ' -> ' + a.innerText); | |
} | |
pokeBack.id = w.setTimeout(pokeBack, a ? 1000: 3000); | |
}; | |
pokeBack.stop = function() { this.stopped = true; } | |
})(window,document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment