Skip to content

Instantly share code, notes, and snippets.

@coleww
Last active August 29, 2015 14:03
Show Gist options
  • Save coleww/75029e1243284b9374be to your computer and use it in GitHub Desktop.
Save coleww/75029e1243284b9374be to your computer and use it in GitHub Desktop.
like every
var likes = document.getElementsByClassName('UFILikeLink');
var comment_likes = [];
var post_likes = [];
for(var i = 0; i<likes.length; i++){
if (likes[i].getAttribute('title') === 'Like this') {
post_likes.push(likes[i]);
} else if (likes[i].getAttribute('title') === 'Like this comment') {
comment_likes.push(likes[i]);
}
}
var zed = 0;
var ned = 0;
var likeStuff = function(){
window.setTimeout(function(){
if(Math.random() < 0.666){
post_likes[zed].click()
} else {
comment_likes[ned].click()
}
zed++;
ned++;
if (zed < post_likes.length && ned < comment_likes.length){
likeStuff();
}
}, 1050);
};
likeStuff();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment