Simple JavaScript to follow/unfollow people on twitter.
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.
$('.button-text.unfollow-text').trigger('click');
$('.ProfileCard-content').each(function() {
var status = $(this).find('.FollowStatus').text();
var unfollowButton = $(this).find('.user-actions-follow-button');
if(!status) {
unfollowButton.click();
}
});
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);
});