Skip to content

Instantly share code, notes, and snippets.

@ChrisLTD
Created November 5, 2018 20:09
Show Gist options
  • Save ChrisLTD/014149548b35e92e539dbf90dfb77556 to your computer and use it in GitHub Desktop.
Save ChrisLTD/014149548b35e92e539dbf90dfb77556 to your computer and use it in GitHub Desktop.
// AUTO TWEET UNLIKER
//
// Go to your Twitter profile
// Click on the tab for your likes
// Open up your JS console
// Paste this script in, and hit [return]
var scrollDelay = 1000; // milliseconds
var scrollAmount = 5;
var clickDelay = 600; // milliseconds
// scroll to the bottom of the page a few times to load a lot of liked tweets
$('html, body').scrollTop($(document).height());
for(var i = 0; i < scrollAmount; i++) {
setTimeout(function() {
$('html, body').scrollTop($(document).height());
}, scrollDelay * i);
}
// start unliking them 1 at a time
setTimeout(function() {
var $tweets = $('.ProfileTweet-action--unfavorite');
$tweets.each(function(index) {
var _this = this;
setTimeout(function() {
$(_this).click();
}, clickDelay * index);
});
setTimeout(function() {
alert('Done unliking tweets')
}, ($tweets.length * clickDelay));
}, (scrollDelay * scrollAmount));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment