atcoder-affiliation-finder

When you click the affiliation, go to the ranking page (everyone who has the same affiliation appears only)

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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         atcoder-affiliation-finder
// @namespace    https://twitter.com/_TTJR_
// @version      0.22
// @description  When you click the affiliation, go to the ranking page (everyone who has the same affiliation appears only)
// @author       tsutaj
// @match        https://atcoder.jp/users/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const linkHeader = 'https://atcoder.jp/ranking?f.Affiliation=';
    const trs = document.querySelectorAll('.dl-table tr');

    trs.forEach(function(tr) {
        if(tr.innerText.search('所属') !== -1 || tr.innerText.search('Affiliation') !== -1) {
            const affiliation = tr.childNodes[1].innerText;
            const link = linkHeader + encodeURIComponent(affiliation);
            tr.childNodes[1].innerHTML = '<a href=' + link + '>' + affiliation + '</a>';
        }
    });
})();