Created
July 5, 2023 23:07
-
-
Save uratmangun/1c7308d3ddbd5633a1c0c231d09d21be to your computer and use it in GitHub Desktop.
unlike twitter
This file contains hidden or 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
var totalHeight = 0; | |
var distance = 100; | |
var timer = setInterval(() => { | |
var scrollHeight = document.body.scrollHeight; | |
window.scrollBy(0, distance); | |
totalHeight += distance; | |
document.querySelectorAll("div[data-testid='unlike']").forEach(a=>{a.click();}) | |
if(totalHeight >= scrollHeight - window.innerHeight){ | |
clearInterval(timer); | |
resolve(); | |
} | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment