Skip to content

Instantly share code, notes, and snippets.

@aruss
Last active December 21, 2015 04:39
Show Gist options
  • Save aruss/6251258 to your computer and use it in GitHub Desktop.
Save aruss/6251258 to your computer and use it in GitHub Desktop.
// paste it in your browsers console while surfing on facebook and you will like all things
(function (){
var d = [],
i = 0,
l = 0,
li = setInterval(function() {
if (i < l) {
console.log('like ' + i + ' out of ' + l);
d[i].onclick();
i++;
}
else {
setTimeout(function() {
window.scroll(0, window.pageYOffset + 100);
}, 500);
}
},400),
f = function() {
var d2 = document.getElementsByClassName('UFILikeLink');
for(var di = 0, dl = d2.length; di < dl; di++) {
if (d2[di]['title'].indexOf('unlike') == -1) {
d.push(d2[di]);
}
}
l = d.length;
},
si = setTimeout(f, 0);
window.onscroll = function() {
clearTimeout(si);
si = setTimeout(f, 1000);
}
})();
@aruss
Copy link
Author

aruss commented Aug 16, 2013

Change if (d2[di]['title'].indexOf('unlike') == -1) to if (d2[di]['title'].indexOf('unlike') == 0) to unlike them all :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment