KAT - Average posts/day

Shows average post per day for a user on KAT

08.09.2015 itibariyledir. En son verisyonu görün.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        KAT - Average posts/day
// @namespace   AveragePosts
// @version     1.05
// @description Shows average post per day for a user on KAT
// @match       http://kat.cr/community/show/*
// @match       https://kat.cr/community/show/*
// @include   /https?:\/\/kat.cr\/user\/[^\/]+\//
// ==/UserScript==

if (window.location.href.search("\/user\/") != -1)
{
    var joinDate = $(".formtable tbody tr:first td:last").text();
    joinDate = joinDate.substring(joinDate.indexOf('(') + 1, joinDate.length - 1);
    var posts = $(".formtable tbody tr td strong a[href^='/community/']").closest("tr").children("td:last").text();
    var start = new Date(joinDate),
    end   = new Date(),
    diff  = new Date(end - start),
    days  = diff/1000/60/60/24,
    ppd = posts/days;
    ppd = Math.round( ppd * 100 ) / 100;
    $(".formtable tbody tr td strong a[href^='/community/']").closest("tr").children("td:last").append(" - " + ppd + " posts per day");
}
else
{
    $("div[id^='post'] .badgeInfo").each(function()
    {
        var joinDate = $(this).children().last().text();     
        var posts = $(this).find("span:eq(3)").text();
        posts = posts.substring(7);

        var start = new Date(joinDate),
        end   = new Date(),
        diff  = new Date(end - start),
        days  = diff/1000/60/60/24,
        ppd = posts/days;
        ppd = Math.round( ppd * 100 ) / 100;
        $('<span class="font11px lightgrey">posts/day: ' + ppd + '</span>').insertAfter($(this).find("span:eq(3)"));
    });
}