Neopets Customisation Spotlight Enhancer

Customisation Spotlight Enhancer: it makes the contestants entries bigger and also includes their Pet name.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Neopets Customisation Spotlight Enhancer
// @namespace    sadMidas
// @version      2024
// @description  Customisation Spotlight Enhancer: it makes the contestants entries bigger and also includes their Pet name.
// @include      https://www.neopets.com/spotlights/custompet/custom_spotlight_votes.phtml*
// @include      *neopets.com/spotlights/custompet/custom_spotlight_votes.phtml*
// @author       sadMidas
// @license MIT
// ==/UserScript==

function findLinkContainingString() {
    var aTags = document.getElementsByTagName("img");
    var petImages = [];

    for (var i = 0; i < aTags.length; i++) {
        if (aTags[i].width == 150) {
            console.log("Found Pet image: " + aTags[i].src);
            petImages.push(aTags[i]);
            console.log(petImages);
        }
    }
    return petImages[1];
}

setTimeout(function(){Main()}, 0);

function Main(){

    var spotlight = findLinkContainingString();
    var oldText = spotlight.src;
    var newText = oldText.replace("/1/2.png", "/1/7.png");
    newText = newText.replace("https://", "//");
    oldText = oldText.replace("https://", "//");

    var petName = newText.split("/");

    var originalText = '<img src="'+oldText+'" width="150" height="150" border="0" style="">';
    var replaceText = '<img src="'+newText+'" border="0" style=""> <h1>'+petName[4]+'</h1>';

    document.body.innerHTML = document.body.innerHTML.replace(originalText, replaceText);

}