KAT - Mass Accept

Adds a button to your profile that will allow you to accept all friend requests

目前為 2014-09-11 提交的版本,檢視 最新版本

// ==UserScript==
// @name        KAT - Mass Accept
// @namespace   MassAccept
// @version     1.01
// @description Adds a button to your profile that will allow you to accept all friend requests
// @require		http://code.jquery.com/jquery-latest.js
// @match     http://kickass.to/user/*
// @match     https://kickass.to/user/*
// ==/UserScript==

var user = $('li > a[href^="/user/"]').attr("href");

if (location.pathname == user)
{
    $("h3:contains('Awaiting my approval')").append('<a id="acceptAll" title="accept all" class="smallButton siteButton" style="margin-left:10px;"><span style="color:white;">accept all</span></a>');
    $("h3:contains('Awaiting my approval')").append('<a id="rejectAll" title="reject all" class="smallButton siteButton" style="margin-left:10px;"><span style="color:white;">reject all</span></a>');
}

$("#acceptAll").click(function() 
{
    $('a[href^="/friend/approve/"]').each(function()
    {
    	$(this).trigger( "click" );
    });
});
    
$("#rejectAll").click(function() 
{
    $('a[href^="/friend/cancel/"]').each(function()
    {
    	if ($(this).text() == "reject")
        {
        	$(this).trigger( "click" );
        }
        // else link is request YOU sent
    });
});