Skip to content

Instantly share code, notes, and snippets.

@michaelnordmeyer
Last active May 1, 2022 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelnordmeyer/bf4a8dc038b0c5092d474aabf1573dac to your computer and use it in GitHub Desktop.
Save michaelnordmeyer/bf4a8dc038b0c5092d474aabf1573dac to your computer and use it in GitHub Desktop.
Deletes all your Twitter likes when being on your profile page twitter.com/<username>/likes as of early 2022
// Deletes all your Twitter likes when being on your profile page twitter.com/<username>/likes
// Barebones script: runs every second, unlikes the topmost like, scrolls to the bottom if no more likes on page
// It won't stop unless manually reloading the page removes this code. Tested with Twitter web May 2022
setInterval(
function() {
console.log('Searching for unlike UI...');
var button = document.querySelectorAll('[data-testid=unlike]')[0]; // find unlike menu
if (button === undefined) {
console.log('No unlike buttons found. Scrolling to load more tweets...');
window.scrollTo(0, document.documentElement.scrollHeight); // scroll to bottom of page to load more
} else {
console.log('Found unlike button. Clicking...');
button.scrollIntoView();
button.click();
console.log('Unliked');
}
}, 1000
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment