Skip to content

Instantly share code, notes, and snippets.

@cqsd
Last active August 23, 2022 14:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cqsd/b03e0c66fb72685ceaa4944c8846533c to your computer and use it in GitHub Desktop.
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)
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