AtCoderAffiliationFinder

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

As of 2019-09-26. See the latest version.

  1. // ==UserScript==
  2. // @name AtCoderAffiliationFinder
  3. // @namespace https://twitter.com/_TTJR_
  4. // @version 0.2
  5. // @description When you click the affiliation, go to the ranking page (everyone who has same affiliation appears only)
  6. // @author tsutaj
  7. // @match https://atcoder.jp/users/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. const linkHeader = 'https://atcoder.jp/ranking?f.Affiliation=';
  15. const trs = document.querySelectorAll('.dl-table tr');
  16.  
  17. trs.forEach(function(tr) {
  18. if(tr.innerText.search('所属') !== -1 || tr.innerText.search('Affiliation') !== -1) {
  19. const affiliation = tr.childNodes[1].innerText;
  20. const link = linkHeader + encodeURIComponent(affiliation);
  21. tr.childNodes[1].innerHTML = '<a href=' + link + '>' + affiliation + '</a>';
  22. }
  23. });
  24. })();
  25.