Полезность

че то там с полезностью

目前為 2021-07-26 提交的版本,檢視 最新版本

// ==UserScript==
// @name         Полезность
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  че то там с полезностью
// @author       S30N1K
// @match        https://dota2.ru/*
// @grant        none
// ==/UserScript==

(() => {
    if (/\/forum\/threads\//.test(window.location.pathname)){
        for (const e of $("#message-list > li > .theme-user-block")){
            const messages = parseInt($(e).find(".forum-theme__item-info-desk > p:nth-child(2)").html().split(":")[1])
            const rating = parseInt($(e).find(".forum-theme__item-info-desk > p:nth-child(3)").html().split(":")[1])
            const respect = parseInt(rating / messages * 100)

            $(e).find(".forum-theme__item-info-desk").append(`<p class='forum-theme__item-info'>Полезность: ${respect}%</p>`)
        }
    }
})()