AJL Score (for 2023)

AtCoderの成績表にAJLのScoreを追加します。

当前为 2023-11-28 提交的版本,查看 最新版本

// ==UserScript==
// @name         AJL Score (for 2023)
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  AtCoderの成績表にAJLのScoreを追加します。
// @author       You
// @match        https://atcoder.jp/users/*/history
// @icon         https://www.google.com/s2/favicons?sz=64&domain=atcoder.jp
// @license MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    console.debug("Loading AJL Scores");
    const table = Array.from(document.querySelector("#history").rows);
    const tableTitleElem = document.createElement("th");
    tableTitleElem.style["text-align"] = "center";
    tableTitleElem.textContent = "AJL";
    table[0].insertBefore(tableTitleElem, table[0].childNodes[5]);
    table.slice(1).forEach((element) => {
        console.log(element.childNodes);
        const perf = Number(element.childNodes[7].textContent);
        const ajlScore = Math.round(Math.pow(2, perf / 400) * 1000);
        const ajlScoreElem = document.createElement("td");
        ajlScoreElem.textContent = ajlScore;
        const ratingElem = element.childNodes[11];
        element.insertBefore(ajlScoreElem, ratingElem);
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址