Greasy Fork is available in English.

AtCoder HashTag Setter

Add Twitter HashTag to share button on AtCoder

Stan na 26-02-2021. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         AtCoder HashTag Setter
// @namespace     https://atcoder.jp/
// @version      1.0
// @description  Add Twitter HashTag to share button on AtCoder
// @author       G4NP0N
// @match        https://atcoder.jp/contests/*
// @grant        none
// ==/UserScript==

window.onload = function() {
    var url = location.href.split("/");
    if(url.length < 5)return;
    var contestId = location.href.split("/")[4];
    var problemId;
    var txt = document.getElementsByClassName("a2a_kit")[0].getAttribute("data-a2a-title");
    txt += " #AtCoder_";
    if(url.length==7){
        if(url[5]=="tasks"){
            txt +=url[6];
        }else if(url[5]=="submissions" && url[6]!="me"){
            txt += document.querySelector("#main-container > div.row > div:nth-child(2) > div:nth-child(9) > table > tbody > tr:nth-child(2) > td > a").getAttribute("href").split("/")[4];
        }else{
            txt+=contestId;
        }
    }else{
        txt += contestId;
    }
    document.getElementsByClassName("a2a_kit")[0].setAttribute("data-a2a-title",txt);
};