Last active
August 23, 2022 14:40
-
-
Save cqsd/b03e0c66fb72685ceaa4944c8846533c to your computer and use it in GitHub Desktop.
script to unlike tweets using twitter web (use on https://twitter.com/USERNAME/likes)
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
document.onscroll = (() => { | |
let totalUnliked = 0; | |
return async () => { | |
const tweets = document.querySelectorAll('[role="article"]'); | |
await tweets.forEach(async e => { | |
const likeButton = document.querySelector('[data-testid="unlike"]'); | |
if (typeof likeButton !== 'undefined' && likeButton) { | |
await likeButton.click(); | |
totalUnliked += 1; | |
console.log(totalUnliked); | |
} | |
}); | |
}; | |
})(); | |
setInterval(() => (window.scrollBy(0, 800)), 800) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment