Sleazy Fork is available in English.

Erome Like Visible On Albums

Show album like count from any page with albums

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Erome Like Visible On Albums
// @namespace    http://tampermonkey.net/
// @version      0.3.3
// @description  Show album like count from any page with albums
// @author       throwinglove23
// @license      MIT
// @match        https://www.erome.com/*
// @match        http://www.erome.com/*
// @exclude      http://www.erome.com/a/*/
// @exclude      https://www.erome.com/a/*/
// @exclude      https://www.erome.com/a/*/edit
// @exclude      http://www.erome.com/a/*/edit
// @icon         https://www.erome.com/favicon-32x32.png
// @grant        none
// ==/UserScript==
/* jshint esversion: 11 */ 

function likeShowable()
{
    const albums = Array.from(document.getElementsByClassName('album-link'));
    albums.forEach(async function(album)
        {
            const hr = album.href;
            const hdr = await fetch(hr);
            const data = await hdr.text();
            var parser = new DOMParser();
            var doc = parser.parseFromString(data, 'text/html');
            // nullish coalescing es11
            let countArea = doc.querySelector('#like_count');
            let count = 0;
            if (countArea == null)
            {
                countArea = doc.querySelector('.far.fa-heart.fa-lg');
                count = countArea.nextElementSibling.firstChild.textContent.trim();
            }
            else
            {
                count = countArea.textContent.trim();
            }
            
            if (+count < 1)
            {
                return;
            }
            if (album.parentElement.querySelector('.album-bottom-right').children.length > 1)
            {
                const viewSec = album.parentElement.querySelector('.album-bottom-right').lastElementChild.insertAdjacentHTML("afterbegin", `<span style="
        position: absolute;
        bottom: 26px;
        right: -0.1px;
    ">${count}</span><i class="ml-5 mr-5 fas pink fa-heart fa-lg" aria-hidden="true" style="bottom: 30px;position: absolute;left: 10px;"></i>`);
            }
            else
            {
                const viewSec = album.parentElement.querySelector('.album-bottom-right').lastElementChild.insertAdjacentHTML("afterbegin", `<span style="
        position: absolute;
        bottom: 26px;
        left: 10px;
    ">${count}</span><i class="ml-5 mr-5 fas pink fa-heart fa-lg" aria-hidden="true" class="ml-5 mr-5"style="bottom: 30px;position: absolute;left: -15px;"></i>`);
            }
        });
}

window.addEventListener('load', likeShowable);