ShikiLink

Добавляет кнопки на сайте Shikimori для поиска аниме на Anime365 и AnimeGO или манги на MangaLib.me

23.04.2023 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.

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         ShikiLink
// @version      0.2
// @description  Добавляет кнопки на сайте Shikimori для поиска аниме на Anime365 и AnimeGO или манги на MangaLib.me
// @author       vuchaev2015
// @match        https://shikimori.me/animes/*
// @match        https://shikimori.me/mangas/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=shikimori.me
// @grant        none
// @namespace Добавляет кнопки на сайте Shikimori для поиска аниме на Anime365 и AnimeGO или манги на MangaLib.me
// ==/UserScript==

function addAnimeLinks() {
  if (document.querySelector("#animes_show") && document.querySelector("#animes_show > section > div > header > meta")) {
    const bDbEntryDivs = document.querySelectorAll(".b-db_entry");
    bDbEntryDivs.forEach((div) => {
      const cImageDiv = div.querySelector(".c-image");
      const animename = document.querySelector("#animes_show > section > div > header > meta").getAttribute("content");

      // Проверяем, существует ли элемент #answer_is_forty_two
      if (cImageDiv.querySelector("#answer_is_forty_two")) {
        return; // Если элемент существует - выходим из функции
      }

      const newDiv = document.createElement("div");
      newDiv.innerHTML = `
        <div id="answer_is_forty_two">
          <a target="_blank" class="b-link_button" title="Anime365" href="https://smotret-anime.com/catalog/search?q=${encodeURIComponent(animename)}" rel="nofollow noopener noreferrer">Anime365</a>
          <a target="_blank" class="b-link_button" title="AnimeGo.org" href="https://animego.org/search/anime?q=${encodeURIComponent(animename)}" rel="nofollow noopener noreferrer">AnimeGo.org</a>
        </div>`;
      cImageDiv.appendChild(newDiv);
    });
  }
}

function addMangaLinks() {
  if (document.querySelector("#mangas_show") && document.querySelector("#mangas_show > section > div > header > meta")) {
    const bDbEntryDivs = document.querySelectorAll(".b-db_entry");
    bDbEntryDivs.forEach((div) => {
      const cImageDiv = div.querySelector(".c-image");
      const animename = document.querySelector("#mangas_show > section > div > header > meta").getAttribute("content");

      // Проверяем, существует ли элемент #answer_is_forty_two
      if (cImageDiv.querySelector("#answer_is_forty_two")) {
        return; // Если элемент существует - выходим из функции
      }

      const newDiv = document.createElement("div");
      newDiv.innerHTML = `
        <div id="answer_is_forty_two">
          <a target="_blank" class="b-link_button" title="MangaLib.me" href="https://mangalib.me/manga-list?sort=rate&dir=desc&page=1&name=${encodeURIComponent(animename)}" rel="nofollow noopener noreferrer">MangaLib.me</a>
        </div>`;
      cImageDiv.appendChild(newDiv);
    });
  }
}

setInterval(function() {
  addAnimeLinks();
  addMangaLinks();
});