Created
May 8, 2017 11:49
-
-
Save JensVerneuer/0f9fb32c78b0a21eb5ed5c22ac830974 to your computer and use it in GitHub Desktop.
Like all posts on your Facebook timeline
This file contains 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
// 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