Skip to content

Instantly share code, notes, and snippets.

@MrDOS
Created January 30, 2017 15:44
Show Gist options
  • Select an option

  • Save MrDOS/c27073349d9a914607a531e0b2d6860a to your computer and use it in GitHub Desktop.

Select an option

Save MrDOS/c27073349d9a914607a531e0b2d6860a to your computer and use it in GitHub Desktop.
Because clicking that “Poke Button” link yourself is just too damn hard.
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