Skip to content

Instantly share code, notes, and snippets.

@JensVerneuer
Created May 8, 2017 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JensVerneuer/0f9fb32c78b0a21eb5ed5c22ac830974 to your computer and use it in GitHub Desktop.
Save JensVerneuer/0f9fb32c78b0a21eb5ed5c22ac830974 to your computer and use it in GitHub Desktop.
Like all posts on your Facebook timeline
// it's pretty obvious, that facebook will block you in case you use this - right?
function scroll2like(){
let scrollActions = 10;
let scrollBy = 1000;
let scrollDelay = 1000;
let scrollDelayHelper = 0;
while(--scrollActions) {
scrollDelayHelper = scrollDelayHelper+scrollDelay
setTimeout(function scroll(){
let likes = document.querySelectorAll('a[aria-pressed="false"]:not(.UFIReactionLink)');
window.scrollBy(0, scrollDelayHelper);
console.log("scrolled", scrollDelayHelper);
[].forEach.call(likes, function eachItem(item) {
item.click();
});
}, scrollDelayHelper);
}
}
scroll2like();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment