Anilist more links (MAL/AniDB)

adds links to anilist/mal site to anilist (uses just the duckduckgo I'm feeling ducky feature with the anime name)

目前为 2022-01-08 提交的版本。查看 最新版本

// ==UserScript==
// @name         Anilist more links (MAL/AniDB)
// @namespace    https://gf.qytechs.cn/en/users/12725-alistair1231
// @version      0.1
// @description  adds links to anilist/mal site to anilist (uses just the duckduckgo I'm feeling ducky feature with the anime name)
// @author       Alistair1231
// @match        https://anilist.co/anime/*
// @icon         https://icons.duckduckgo.com/ip2/anilist.co.ico
// @grant        none
// @require https://code.jquery.com/jquery-3.6.0.min.js
// @license GPL-3.0
// ==/UserScript==

(function () {
    "use strict";
    let ready = setInterval(checkReady, 100);
    function checkReady() {
      if (jQuery(".content h1")[0]) {
        run(ready);
      }
    }
  })();
  
  function run(ready) {
    clearInterval(ready);
  
    let linkBar = jQuery("div.external-links h2~div");
    let name = jQuery(".content h1")[0].innerText;
    let mal =
      "https://duckduckgo.com/?q=!ducky+" + name + "+site%3Amyanimelist.net";
    let anidb = "https://duckduckgo.com/?q=!ducky+" + name + "+site%3Aanidb.net";
    linkBar.prepend(createButton(mal, "MAL"));
    linkBar.prepend(createButton(anidb, "AniDB"));
  
    //   let kitsu =
    //     "https://duckduckgo.com/?q=!ducky+" + name + "+site%3Akitsu.io";
    //     linkBar.prepend(createButton(kitsu, "kitsu"));
  }
  
  function createButton(link, name) {
    let a = document.createElement("a");
    jQuery(a).attr("data-v-7a1f9df8", "");
    a.href = link;
    a.target = "_blank";
    jQuery(a).addClass("external-link");
    a.innerHTML = name;
    // make purple
    jQuery(a).css("background", "rgb(150, 59, 241)");
    return a;
  }
  

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址