Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove your Twitter likes
// [Updated 2021-01-18 w/new selectors]
// go to your account Likes page and run this in the console:
function scrollToLoadMore() {
// keep scrolling if twitter tries to stop loading more.
// scroll up, then down to force infinite load.
window.scrollTo(0, 0);
setTimeout(function() {
window.scrollBy(0, 9999999999);
}, 200);
}
function removeTweet(tweetEl) {
// show it
tweetEl.style.backgroundColor = 'rgba(255,0,0,0.5)';
tweetEl.scrollIntoView();
window.scrollBy(0, -150);
// remove it
setTimeout(function() {
tweetEl.parentNode.removeChild(tweetEl);
}, 750);
}
function removeFav() {
let buttonEl = document.querySelector('[data-testid="unlike"]');
if(buttonEl) {
let tweetEl = buttonEl.closest('article');
if(tweetEl) {
buttonEl.click();
removeTweet(tweetEl);
}
} else {
console.log('No Tweets found');
scrollToLoadMore();
}
}
let unfavInterval = setInterval(removeFav, 1500);
@ChristianO0214

This comment has been minimized.

Copy link

@ChristianO0214 ChristianO0214 commented Dec 11, 2018

How do I use this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment