gleam.io days in title

Shows the runtime of the contest in the title

27.11.2021 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.

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         gleam.io days in title
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Shows the runtime of the contest in the title
// @author       woebbi
// @license     GNU GPLv3 https://choosealicense.com/licenses/gpl-3.0/
// @match        *gleam.io/*
// @icon         https://www.google.com/s2/favicons?domain=gleam.io
// @grant        none
// ==/UserScript==

$(document).ready(function() {
    if (document.getElementsByClassName("status ng-binding")[1] !== null) {
        var status = document.getElementsByClassName("status ng-binding");
        var duration = status[status.length - 1].innerHTML.trim();


        var descr = document.getElementsByClassName("description ng-binding")
        descr = descr[descr.length - 1].innerHTML;
        var timething = descr.trim().charAt(0).toLowerCase();
        if (duration == "Ended"){
            duration = "e";
            timething = ""
        }
        console.log(duration + " " + timething);
        var textfortitle = "(" + duration + timething + ")";
        document.title = textfortitle + document.title;
    }
});