TwitterUnfollow

Quick Unfollow button for every tweet and mass unfollow button for the following page.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @id twitterUnfollow.js
// @name TwitterUnfollow
// @description Quick Unfollow button for every tweet and mass unfollow button for the following page.
// @homepageURL https://github.com/mymizan/signal-to-noise
// @author M Yakub Mizan
// @version 1.0.0
// @date 2016-11-16
// @namespace http://mymizan.rocks/
// @include https://twitter.com/*
// @grant GM_xmlhttpRequest
// @grant GM_getValue
// @grant GM_setValue
// @run-at document-end
// @license MIT License
// ==/UserScript==

(function() {
    'use strict';
    function watchAjaxLoad()
    {
        $('.stream-item-header .quick_unfollow').remove();
        $('.stream-item-header').append('<a href="#" class="pull-right quick_unfollow"> Unfollow </a>');
        setTimeout( watchAjaxLoad, 300 );
    }
    watchAjaxLoad();
    $('.quick_unfollow').live('click', function(e){
        e.preventDefault();
        var save_context = this;
        $(this).parent().parent().parent().parent().hide();
        $.post('/i/user/unfollow',{authenticity_token: $('.authenticity_token').val(), challenges_passed: false, handles_challenges: 1, user_id: $('a', $(this).parent()).eq(0).attr('data-user-id')},function(data){
            $(save_context).parent().parent().parent().parent().remove();
        });
        $(this).parent().parent().parent().parent().remove();
    });
})();