e-hentai add karma link

e-hentai auto add karma link in [Karma Log] page

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey 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 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.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

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        e-hentai add karma link
// @namespace   https://greasyfork.org/scripts/473762
// @version     1.1
// @description e-hentai auto add karma link in [Karma Log] page
// @author      fmnijk
// @match       https://e-hentai.org/*
// @icon        https://www.google.com/s2/favicons?domain=e-hentai.org
// @grant       none
// @run-at      document-end
// @license     MIT
// ==/UserScript==

/* main function */
(function() {
    'use strict';

    if (window.location.href !== 'https://e-hentai.org/logs.php?t=karma'){
        return false;
    }

    var th = document.createElement('th');
    th.textContent = 'Reply';
    th.style = 'text-align:left; border-bottom:1px solid #5C0D12; width:50px';
    var referenceNode = document.querySelector('body > div:nth-child(5) > table > tbody > tr:nth-child(1) > th:nth-child(4)');
    referenceNode.parentNode.insertBefore(th, referenceNode);

    var lastRowIndex = document.querySelector('body > div:nth-child(5) > table > tbody').rows.length;
    for (var i = 2; i <= lastRowIndex; i++) {
        var a = document.createElement('a');
        var href = document.querySelector('body > div:nth-child(5) > table > tbody > tr:nth-child(' + i + ') > td:nth-child(3) > a').href;
        var showuser = href.split('=')[1];
        a.href = 'https://e-hentai.org/dmspublic/karma.php?u=' + showuser;
        a.textContent = 'k+';
        var td = document.createElement('td');
        td.style = 'text-align:left; vertical-align:top';
        td.appendChild(a);
        referenceNode = document.querySelector('body > div:nth-child(5) > table > tbody > tr:nth-child(' + i + ') > td:nth-child(4)');
        referenceNode.parentNode.insertBefore(td, referenceNode);
    }
})();