Last active
March 14, 2023 18:52
-
-
Save LaruYan/8090c59ee6012b436be8d063b45bfe75 to your computer and use it in GitHub Desktop.
Unfavourite Tweet button clicker (scrolls through and unlike/unfavourite tweets from your own likes/favourites only)
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
var unfavTweetsTimer = null; | |
var doUnfavTweetsFn = () => { | |
clearInterval(unfavTweetsTimer); | |
Array.from(document.querySelectorAll('article[data-testid="tweet"] div[data-testid="unlike"]')) | |
.forEach(unlikeBtn => { | |
unlikeBtn.click(); | |
}) | |
window.scrollTo({ | |
top: document.body.scrollHeight, | |
left: 0, | |
behavior: 'auto' | |
}); | |
unfavTweetsTimer = setInterval(doUnfavTweetsFn, 500); | |
}; | |
unfavTweetsTimer = setInterval(doUnfavTweetsFn, 16); |
For faster processing, I recommend a rule for uBlock Origin. this prevents images on each tweet from loading
add this in "My Filters" Tab on uBlock Origin's settings page.
twitter.com##section > div figure
don't forget to remove this after done unliking :)
fixed a selector error tweetEntries.queryselectorAll is not a function
Thanks, this is one of the better scripts I've found for this. Still working as of 3/14/23.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DESIGNED TO RUN THIS ON YOUR LIKES PAGE
"Likes" page on address bar looks like