Skip to content

Instantly share code, notes, and snippets.

@Rayraegah
Last active August 9, 2018 23:27
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 Rayraegah/2b74af0b07a609b02dbfd0cf63fcc7a9 to your computer and use it in GitHub Desktop.
Save Rayraegah/2b74af0b07a609b02dbfd0cf63fcc7a9 to your computer and use it in GitHub Desktop.
nuke_my_friends

Nuke My Friends

Simple JavaScript to follow/unfollow people on twitter.

Setting up

Go to www.twitter.com/following

In browser console, use

setInterval(function() { window.scrollTo(0, document.body.scrollHeight); }, 2000);

This will scroll the page all the way to the bottom and load all DOM elements for followers.

Unfollow everyone

$('.button-text.unfollow-text').trigger('click');

Unfollow !followers

$('.ProfileCard-content').each(function() { 
    var status = $(this).find('.FollowStatus').text(); 
    var unfollowButton = $(this).find('.user-actions-follow-button'); 
    if(!status) {
      unfollowButton.click();
    }
});

Follow someone's followers

Go to their followrs page, repeat setting up and then use

__cnt__ = 0;
jQuery(".Grid-cell .not-following .follow-text").each(function(i, ele) {
	ele = jQuery(ele);
	if (ele.css("display") != "block") {
		console.log("already following:", i);
		return;
	}
	setTimeout(function() {
		ele.click();
	}, __cnt__++ * 500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment