Skip to content

Instantly share code, notes, and snippets.

@WisaniShilumani
Last active August 18, 2019 16:16
Show Gist options
  • Save WisaniShilumani/5bfaf72f9c64f5a8977396ae4b86c318 to your computer and use it in GitHub Desktop.
Save WisaniShilumani/5bfaf72f9c64f5a8977396ae4b86c318 to your computer and use it in GitHub Desktop.
const likeAll = () => {
const likes = document.querySelectorAll('.glyphsSpriteHeart__outline__24__grey_9')
console.log(`I'm going to like ${likes.length} posts`)
likes.forEach(element => {
element.click()
})
}
var scroller = function(by) {
window.scrollBy(0, by)
}
var startInterval = function(scrollBy, speed, endby) {
var interval = setInterval(() => {
this.scroller(scrollBy)
}, speed*1000)
setTimeout(() => {
clearInterval(interval)
likeAll()
}, endby*1000)
}
startInterval(5000, 0.5, 30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment