Greasy Fork is available in English.

AtCoder Twitter Avatar

Display Twitter avatar on AtCoder user page

02.12.2018 itibariyledir. En son verisyonu görün.

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         AtCoder Twitter Avatar
// @namespace    https://ciffelia.com/
// @version      1.0.1
// @description  Display Twitter avatar on AtCoder user page
// @author       prince <[email protected]> (https://ciffelia.com/)
// @license      MIT
// @homepage     https://github.com/prince0203/atcoder-twitter-avatar#readme
// @supportURL   https://github.com/prince0203/atcoder-twitter-avatar/issues
// @match        http*://atcoder.jp/user/*
// @match        https://beta.atcoder.jp/users/*
// @run-at       document-end
// ==/UserScript==

(function () {
  'use strict';

  const twLinkElm = document.querySelector('a[href*="//twitter.com/"]');

  if (twLinkElm !== null) {
    const screenName = twLinkElm.innerText;
    const avatarUrl = `https://avatars.io/twitter/${screenName}/small`;

    const avatarElm = document.createElement('img');
    avatarElm.src = avatarUrl;
    avatarElm.referrerPolicy = 'no-referrer';
    Object.assign(avatarElm.style, {
      width: '20px',
      height: '20px',
      marginRight: '5px',
      borderRadius: '50%'
    });

    twLinkElm.insertAdjacentElement('afterbegin', avatarElm);
  }

}());