NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @namespace https://openuserjs.org/users/mrbl // @author mrbl // @name Shikimori Links on trace.moe // @description Заменяет в постере ссылку anilist.co на ссылку shikimori.one // @copyright 2019, mrbl (https://openuserjs.org/users/mrbl) // @license MIT // @version 0.1.2 // @include *://trace.moe/* // @run-at document-end // @grant none // ==/UserScript== // ==OpenUserJS== // @author mrbl // ==/OpenUserJS== function replaceLinks() { var info = document.getElementById("info"); if (info) { var title = info.getElementsByTagName("H2")[0]; var infoText = document.getElementById("naturalText"); if (title && infoText) { title = title.innerText; var shikiLink = "https://shikimori.one/animes/"; infoText = infoText.innerText; //Тип if (infoText.indexOf("TV") > -1) shikiLink += "kind/tv/"; else if (infoText.indexOf("MOVIE") > -1) shikiLink += "kind/movie/"; else if (infoText.indexOf("OVA") > -1) shikiLink += "kind/ova/"; else if (infoText.indexOf("ONA") > -1) shikiLink += "kind/ona/"; else if (infoText.indexOf("SPECIAL") > -1) shikiLink += "kind/special/"; else if (infoText.indexOf("MUSIC") > -1) shikiLink += "kind/music/"; //Дата выхода var anidate = infoText.split(' to ')[0].split(' '); anidate = anidate[anidate.length - 1]; anidate = new Date(anidate); //Статус /*if((Date.now()-anidate) > 0 && infoText.indexOf("Released") < 0) { shikiLink += "status/ongoing/"; } else if((Date.now()-anidate) > 0 && infoText.indexOf("Released") >-1) { shikiLink += "status/released/"; }*/ //Сезон if (anidate.getFullYear()) { shikiLink += "season/" + anidate.getFullYear(); } //Постер var poster = document.getElementById("poster"); var posterLink = poster.getElementsByTagName("A")[0]; if (posterLink.href.indexOf("anilist.co") > -1) { posterLink.href = shikiLink + "?search=" + title; } //Студия var table = document.getElementById("table"); var studio = table.getElementsByTagName("A")[0]; if (studio.href.indexOf("anilist.co/studio") > -1) { studio.href = "https://www.google.com/search?q=" + studio.innerText + "+site%3Ashikimori.one"; } } } } replaceLinks(); var observer = new MutationObserver(function (mutations) { replaceLinks(); }); var config = { childList: true, subtree: true, attributes: true }; observer.observe(document.body, config);