Last active
April 21, 2016 00:43
-
-
Save sagz/1301765bab6634f230cf63e1dc915f76 to your computer and use it in GitHub Desktop.
Auto pokeback your Facebook Friends. Works on Greasemonkey, Vivaldi, Chromium, Chrome, Opera
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
// ==UserScript== | |
// @name Facebook Poke Bot | |
// @namespace http://sagz.in/ | |
// @version 1.1 | |
// @description Return FB Pokes | |
// @author Sagar Savla | |
// @match https://mtouch.facebook.com/pokes/* | |
// @grant none | |
// ==/UserScript== | |
function updatePoke(){ | |
let pokebuttonclass = "_56bz _54k8 _56bs _56bu"; // mtouch.facebook.com | |
//let pokebuttonclass = "_42ft _4jy0 _4jy3 _4jy1 selected _51sy"; //www.facebook.com | |
var gg = document.getElementsByClassName(pokebuttonclass).length | |
if(gg>0){ | |
for (var i in document.getElementsByClassName(pokebuttonclass)){ | |
let pbutton = document.getElementsByClassName(pokebuttonclass)[i]; | |
if (pbutton.innerHTML && pbutton.innerHTML.includes('Back')){ | |
pbutton.click(); | |
//console.log(pbutton.innerHTML); | |
} | |
} | |
} | |
} | |
function randomIntFromInterval(min,max) | |
{ | |
return Math.floor(Math.random()*(max-min+1)+min); | |
} | |
// Randomize how quick to Poke back to make it seem human | |
(function loop() { | |
var rand = randomIntFromInterval(10,1000)*1000; | |
console.log(rand); | |
setTimeout(function() { | |
updatePoke(); | |
loop(); | |
}, rand); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment