Epitech PowerUp

Add infos on user page

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(Tôi đã có Trình quản lý tập lệnh người dùng, hãy cài đặt nó!)

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.

(I already have a user style manager, let me install it!)

// ==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)