osu! Alternative Add Friend Button

osu! Alternative Add Friend Button. ts8zs' request

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name           osu! Alternative Add Friend Button
// @description    osu! Alternative Add Friend Button. ts8zs' request
// @author         JebwizOscar
// @icon           http://osu.ppy.sh/favicon.ico
// @include        http://osu.ppy.sh/u/*
// @include        https://osu.ppy.sh/u/*
// @grant          GM_setValue
// @grant          GM_getValue
// @version        1.0.0.3
// @namespace https://greasyfork.org/users/3079
// ==/UserScript==
function AddFriend(){
	$.post('//osu.ppy.sh/forum/ucp.php?i=zebra&mode=friends',
		{localUserCheck:localUserCheck,add:$('.profile-username').text().replace(/\n/g,''),submit:'Submit'},
		function(data){
			j = data;
			sid = j.match(/name="sid" value="([0-9a-f]*)"/)[1];
			add = j.match(/name="add" value="(.*?)"/)[1];
			uid = j.match(/name="user_id" value="([0-9]*)"/)[1];
			cky = j.match(/friends&&confirm_key=(.*?)"/)[1];
			$.post('//osu.ppy.sh/forum/ucp.php?i=zebra&mode=friends&&confirm_key='+cky,{
					confirm:'Yes',
					localUserCheck:localUserCheck,
					sid:sid,
					mode:'friends',
					sess:sid,
					add:add,
					user_id:uid,
					submit:1
				},function(data){
					location.reload();
				}
			);
		}
	);
}
script = document.createElement("script"), 
script.innerHTML = AddFriend;
document.body.appendChild(script);

$( document ).ready( function(){
	$($('a>i.icon-plus-sign').parent()).attr('href','#').attr('onclick','AddFriend()');
});