Greasy Fork

Twitter Unfollower

Automatic Twitter unfollower tool. Last Update: 11-22-2014

当前为 2014-11-22 提交的版本,查看 最新版本

// ==UserScript==
// @name         Twitter Unfollower
// @version      0.1
// @description  Automatic Twitter unfollower tool. Last Update: 11-22-2014
// @author       [email protected]
// @namespace    https://greasyfork.org/en/users/6473-ekin
// @match        https://twitter.com/following
// @grant        none
// ==/UserScript==

$(function() {
    
    var config = {
        editBtn: ".UserActions-editButton",
        intervalTime: 2000
    };
    
    $(config.editBtn).before('<button type="button" id="unfollowBtn" class="edit-button btn"><span class="button-text unfollow-text">Start Unfollowing</span></button> ');

    function unfollowAll() {
        $(".user-actions").each(function() {
            if (/not-following/i.test($(this).attr("class")) == false) {
            	$(this).children(".follow-button").trigger("click");
            }
        });  
    }
    
    function unfollowInit() {
        unfollowAll(); 
        setInterval(function() {
            unfollowAll();
            $("html, body").animate({ scrollTop: $(document).height() }, 1000);
        }, config.intervalTime);
    }
    
    $("#unfollowBtn").click(function() {
        unfollowInit();
    });
    
});