Skip to content

Instantly share code, notes, and snippets.

@LaruYan
Last active March 14, 2023 18:52
Show Gist options
  • Save LaruYan/8090c59ee6012b436be8d063b45bfe75 to your computer and use it in GitHub Desktop.
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)
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);
@clippyspeaks
Copy link

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