Script de Tampermonkey para ver mensajes/día y ratio de Zanks en la info. de usuario

Revisión 25/03/22

JavaScript:
//==UserScript==
// @name         we the pipol
// @description  Script para ver el Karma (Mensajes / Num. Zanks) y los mensajes por dia de los usuarios
// @version      1.0
// @author       Delco
// @include     *://www.burbuja.info/inmobiliaria/threads/*
// @run-at      document-end
// ==/UserScript==

'use strict'

for (var i = 0, len = document.getElementsByClassName("message-userExtras").length; i < len; i++) {
    var months = ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
        gethtml = document.getElementsByClassName("message-userExtras")[i].innerHTML.replace(/<[^>]*>?/gm, " ").split(" ").slice(0, 20);
    var data = [parseInt(gethtml[12].replace(".", "")), parseInt(gethtml[18].replace(".", ""))],
        autoestimita_majadera = (data[1] / data[0]).toFixed(2),
        formateofecha = (months.indexOf(gethtml[5]) + 1) + "/" + gethtml[4] + "/" + gethtml[6],
        fechas = [new Date(formateofecha), new Date()],
        difference_in_time = fechas[1].getTime() - fechas[0].getTime();

    if (difference_in_time < 864e5) {
        var difference_in_days = 1;
    } else difference_in_days = parseInt(difference_in_time / 864e5);

    var mdia = (data[0] / difference_in_days).toFixed(2),
        replacements = document.getElementsByClassName("message-userExtras")[i];

    replacements.insertAdjacentHTML("beforeend", "<br>")
    replacements.insertAdjacentHTML("beforeend", '<dl class="pairs pairs--justified"><dt>Karma</dt><dd>' + autoestimita_majadera + "</dl>")
    replacements.insertAdjacentHTML("beforeend", '<dl class="pairs pairs--justified"><dt>M/Día</dt><dd>' + mdia + "</dl>")
}
 
Última edición:
Volver