Epitech PowerUp

Add infos on user page

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        Epitech PowerUp
// @namespace   [email protected]
// @description Add infos on user page
// @include     https://intra.epitech.eu/user/*
// @version     0.0.3
// @grant       none
// ==/UserScript==

total = 0;
i = 0;

setTimeout(function () {
    if (document.readyState != "complete") {
        console.log("Wait page");
    }
    if (!(elem = document.getElementById("user-module"))) {
        console.log("wait user-module")
    }
    if (!(elem = elem.getElementsByClassName("overflow")[0])) {
        console.log("wait overflow")
    }
    if (!(elem = elem.getElementsByTagName("tbody")[0])) {
        console.log("wait tbody")
    }
    if (!(elem = elem.getElementsByClassName("item"))) {
        console.log("wait item")
    }
    while (elem[i]) {
        cred = elem[i++].getElementsByClassName("number")[0];
    	total = total + Number(cred.innerText);
    }
    if (elem = document.getElementsByClassName("note")[0]) {
        if (note = elem.getElementsByTagName("span")[0]) {
            note.innerText = note.innerText + " / " + total;
        }
    }
}, 500)