Find The Correct Watch Order And All Related Entries+Live-Actions+Doramas + Copy Entry Title

The script shows you the Correct Watch Order And All Related Entries. The script can also auto find if an anime has any Live-Action or Drama adaptations, and the script can Copy The Anime/Manga Title.

目前為 2020-11-24 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Find The Correct Watch Order And All Related Entries+Live-Actions+Doramas + Copy Entry Title
// @namespace    Search for Live-Actions\Doramas\All Related Entries + Correct Watch Order + Copy Entry Title
// @version      2.0.0.9
// @description  The script shows you the Correct Watch Order And All Related Entries. The script can also auto find if an anime has any Live-Action or Drama adaptations, and the script can Copy The Anime/Manga Title.
// @author       hacker09
// @include      /^https:\/\/myanimelist\.net\/anime\/[\d]+(\/.*)?/
// @include      /^https:\/\/myanimelist\.net\/manga\/[\d]+(\/.*)?/
// @grant        none
// @run-at       document-end
// ==/UserScript==
//The lines below are the beginning of the function
(function() {
  //Find and Select the entry title
  var titleElem = document.querySelector(".title-name").firstChild;
  //The line below creates an "a" element so the buttons will appear
  var findButton = document.createElement("a");
  var copyButton = document.createElement("a");
  var chiakiButton = document.createElement("a");
  //The line below detects the anime id to be added on chiaki website
  var animeid = location.pathname.match(/\d+/)[0];
  var ChiakiAnimeTitle,ChiakiAnimeTitleWithSymbols,response2,html2,newDocument2,content2,MyDramaListAsianWikiText,MyDramaListCheck,MalClubText; //Make these variables global

  //The lines below will detect the single mouse click and copy the entry title with symbols to the clipboard
  copyButton.addEventListener("click",()=>{navigator.clipboard.writeText(titleElem.textContent)});
  //The lines below will detect the double mouse click and copy the entry title without symbols to the clipboard
  copyButton.addEventListener("dblclick",()=>{navigator.clipboard.writeText(titleElem.textContent.replace(/[^a-zA-Z0-9]+/g, " "))});
  //The line below detects a mouse hover on the button and show the text Copy Entry Title
  copyButton.setAttribute("title", "1 Click To Copy Entry Title (+ Symbols)\n2 Clicks To Copy Entry Title (Without Symbols)");
  //The lines below are the CSS for the copy button
  copyButton.setAttribute("style", "cursor: pointer;margin-left: 13px;height: 10px;width: 10px;background-size: cover;display: inline-block;transform: scale(1.8);vertical-align: top;margin-top: 7px;");
  //The line below defines where the button should appear
  titleElem.appendChild(copyButton);
  //The lines below are the copy button image converted to DATA URI
  copyButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkBhcOBQkNughZAAADCUlEQVRIx6XWS2hcVRzH8c90Jklji5qkmKipolFb2iBDQSw+KhXBRbEKLYqIiCi+4kLoJrgQfKAgiChN8UEXCr6KFVxUcFFQa6TpWDNGKUpcqKAMTU2lNdpEZ66LmTtz53FnbvQ3i5lz7r3f+/v//mcOJyWibPlrk11uNiCJin70lgnHIY909OoQ3GSvrc5KhGOFftdb53OnKCDT4G/Ey9bhmO8UpTrgAqtsMuRWcx7xt3pgpdzTcqY879cE/gJpV3nVqB1edwQ1D5X8unQJ/JWw4LIeskfKmD35msMKrtd6a2WiL6rTvBm/hfFXn5u1aKX+8kwmgrvauC3ObpPckq894wDZCjIvSyCIdinUdd52m34Z6dhPr8322hkx0aSwKed6yqUCn/jIHy09lgx7zGqDduP9msvWwM2uwQH3OhFb8HoPWk17ZAjcqEfRm2VcqzdnyVSdR5CNCjPsxVI8rlJ0LfxBu8tZxgHLSrXBcUIhMho0YUcnYHsd94ZSZHyeF1wZl2E0q3i9YpX7DVZsZFzsdjMdgNhgq+66mcC0Q0oWPO0dl+kSWONZQ0aJLutWwDVec23TbMF2OQRmzVYKHjcU6XwscGV5W2xQv75ow7KkpRrdtQb+4nF36GqYnTQpkZqBgX32N3Q/8E8yXOumUFRsNZ1NAFzOOvzPDm+0XXdz3CAlcNh7lpIDz/eS0bYm7vazT5OXHLTOL6JSuzuaHRaMuUVP25Knlpdh4jWXrOT/qdbrsLvNiwKLywOucJc7G3abeuAhLzodGQ/oxp9xwAs96ZK2Vd1gysdV3AXukXbGsbgMF/zUIaaCuervDd61DV84HOdw3gO26InFleRNV0cjRvCDJ/weB1TdQpOo5KTPPCcXTkSBqfLum+9IydbuznnUt87UnguB8+hxuYPJNikMG8D3viwPQxsh8KiT+oyZkUtwcuUi4/ootyJaUwic9oH7jNrvKwsdgIGMja7AER82XkxVM1lrwrZl/RW/8bDJxszTVE7/pxy0aNg5CaCBOfvschR15xP+BXLUxMa/tU5OAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA2LTIzVDE0OjA1OjAzKzAwOjAw5sMT7QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wNi0yM1QxNDowNTowMyswMDowMJeeq1EAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC)";
  //********************************************************************************************************************************************************************
  if (window.location.pathname.split('/')[1] === 'anime')
   {

  async function GetAnimeTitle() //Creates a function to Process the GetAnimeTitle
   { //Starts the function
     const response = await fetch('https://api.allorigins.win/raw?url=https://chiaki.site/?/tools/watch_order/id/'+animeid); //Fetch
     const html = await response.text(); //Gets the fetch response
     const newDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response
     ChiakiAnimeTitle = newDocument.querySelector("h2").innerText.split(' Watch Order')[0].replace(/[^a-zA-Z0-9]+/g, " ").trim();
     ChiakiAnimeTitleWithSymbols = newDocument.querySelector("h2").innerText.split(' Watch Order')[0].trim();

     response2 = await fetch("https://api.allorigins.win/raw?url=https://mydramalist.com/search?q=" + ChiakiAnimeTitle); //Fetch
     html2 = await response2.text(); //Gets the fetch response
     newDocument2 = new DOMParser().parseFromString(html2, 'text/html'); //Parses the fetch response
     content2 = newDocument2.querySelector("div.col-lg-8.col-md-8");

     if (newDocument2.body.innerText.search(' found for: ') > -1)
      {
        MyDramaListAsianWikiText = ',AsianWiki and MyDramaList';
        MyDramaListCheck = '👍 Found on MyDramaList.';
      }
     else
      {
        MyDramaListAsianWikiText = ' and AsianWiki';
        MyDramaListCheck = '✖ NOT Found on MyDramaList.';
      }
   } //Finishes the async condition
   GetAnimeTitle(); //Call the GetAnimeTitle function

  //The lines below will detect the mouse click, and search for the anime title
  findButton.addEventListener("click",()=>{
   async function CheckWithAMALClub() //Creates a function to Check With A MAL Club
    { //Starts the function
     const response1 = await fetch('https://myanimelist.net/clubs.php?cid=5450'); //Fetch
     const html1 = await response1.text(); //Gets the fetch response
     const newDocument1 = new DOMParser().parseFromString(html1, 'text/html'); //Parses the fetch response
     var content1 = newDocument1.querySelector("#content > table > tbody > tr > td:nth-child(2) > div");

     newDocument1.body.innerText.search(ChiakiAnimeTitleWithSymbols) > -1 ? MalClubText = '👍 Found on this MAL Club https://bit.ly/38KZxwH.' : MalClubText = '✖ NOT found on this MAL Club https://bit.ly/38KZxwH';

     if (confirm('Anime Title: '+ChiakiAnimeTitle+'\n\n'+MyDramaListCheck + '\n' + MalClubText + '\n\nDo you want to open IMDB'+MyDramaListAsianWikiText+' to confirm that information and get more detailed info?'))
     {
       window.open("https://www.imdb.com/find?q=" + ChiakiAnimeTitle +"&s=tt&ref_=fn_al_tt_mr", "_blank");
       window.open("http://asianwiki.com/index.php?title=Special%3ASearch&search=" + ChiakiAnimeTitle, "_blank");
       if (MyDramaListCheck.match('NOT') === null) {window.open("https://mydramalist.com/search?q=" + ChiakiAnimeTitle, "_blank");}
     } //Finishes the if condition
   } //Finishes the async function
  CheckWithAMALClub(); //Calls the function CheckWithAMALClub
});
  //The line below detects a mouse hover on the button and show the text Find Live-Actions
  findButton.setAttribute("title", "Search for Live-Actions/Doramas");
  //The lines below are the CSS for the findButton
  findButton.setAttribute("style", "cursor: pointer;margin-left: 15px;height: 10px;width: 10px;background-size: cover;display: inline-block;transform: scale(1.8);vertical-align: top;margin-top: 7px;");
  //The line below defines where the button should appear
  titleElem.appendChild(findButton);
  //The lines below are the copy button image converted to DATA URI
  findButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkBhcOEyPKmXRYAAACrElEQVRIx+3U32uVdRzA8de2s01d82wQ2GhotNYYSgqlzhSpIVhasF1IkP9ABbsLcdqFuIu6KOxyN120C5EIEemHlLSIkOEyWkRSHofb9NDaGQo7nZ7mtm8X6WmLneec7XTp+7n58nwe3t/P5/t5Pl8eUC4VBSMN2rRpUitr3FXXRavfZqMjhmSF/DPlU4clV5Nhwit6bXbHZd8Z85ekVjttk/CFE4ZWlttaJ0Wy+m1XveQAXnZBMOHQSnQJJy1I6cY6B7zrvDOeuBdd7y05GV2lCw+LpOzGbhfMCiKjduTjlXpErtlSmm6Tn2R1o9stwVde86wWVUtqeE8woKYU4RFBP3a5KedogZ42+9GMvcV1DYbcsd0anwiOx/yhbwpOFRfulPWlavtEvtEY8+VTpg1rWD5YmV+1qXPFXc+p9bHbMcIbUh7TVEzYhDG0mzMSW0tOWr2HiwlrESFlyGiscEGkqlCfE/lVFkn0WWsqVlil3l25YsJxtCIrK56kjW77vVjJV2XsuNfdpPoYYZsWv/qtmPC6y7bag6QB78fMQpd1LvqjmDByWsIb6s3JmBYK6LZ5Vdo5JbDe54JjqFlydS2m0TlBXyk66DAh6/VFeS+lQb9g0IZShRyS8ae3l52Drc4KfvB0zJwvQ5drgit6tHtIpQoJjTq8Y0Iw6BknfKDV4x4pVbnFgBnBpG+d8aGzvjcjuKXPBgmnBSlpP+speNb/ocZepwybEpmVkzboeP6e3mzMghHTZh0rVflPC9rt0alDi7pF7580acSjXnJzpcrlaZaS8SIO/j/KCkfNG/dCXtm76E5YFWv0mTORzzJr//1Q1aqEcy4JDnjeLz5TZ79RX5cjZN4l8w7qVGefTT4yXF7RUK3XjCC4qPnfAy6HhE67TDovXX5+D7jP32Dw0Zd65WyaAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA2LTIzVDE0OjE5OjI4KzAwOjAwfVN/JAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wNi0yM1QxNDoxOToyOCswMDowMAwOx5gAAAAASUVORK5CYII=)";
  //********************************************************************************************************************************************************************
  //The line below detects the mouse click, and search for related anime entries on MAL and shows the correct watch order for the whole anime
  chiakiButton.setAttribute("href", "https://chiaki.site/?/tools/watch_order/id/"+animeid);
  //The line below specifies that the link should be opened on a new tab
  chiakiButton.setAttribute("target", "_blank");
  //The line below detects a mouse hover on the button and show the text Find Live-Actions
  chiakiButton.setAttribute("title", "Find Related Entries + Correct Watch Order");
  //The lines below are the CSS for the chiakiButton
  chiakiButton.setAttribute("style", "margin-left: 15px;height: 10px;width: 10px;background-size: cover;display: inline-block;transform: scale(1.8);vertical-align: top;margin-top: 7px;");
  //The line below defines where the button should appear
  titleElem.appendChild(chiakiButton);
  //The lines below are the copy button image converted to DATA URI
  chiakiButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAeFBMVEUAAADfceLecePYcefycdTMcfHZcefPce7tcdfQce3tcdffceLQce3tcdfeceLmcdziceDycdPLcfDYceflcd3KcfHycdPzcdPUce3tcdricePxtPDlkev0w/Pjg+ftf97ae+v10fboqvLvourvm+ftieHkm+/ah+6xZFdBAAAAGHRSTlMAFypl7u3s3t21tYlzc/Dv6MPCwsKJiWWHdugpAAAA1klEQVQY013Q2XLCMAwFUMehCQkJe4sW2wlZyv//YWVVzAD3yT5zNV6cxndNDVA3nXfPFOX5CzTVpSzMvpWMd8WHERDtVUs1U8mxlDPOLz3N1bvuvziOMIZAKREeetcAPCZmDpAip3kZCFtXg1Q4hpHCPXKcecCtk9HfKd6nKaWMLIgZH7kZkjRlIYYynrtMRIGXNfKCMt4YSuZZWMZb11UAlJIYDuuKOOCmd/5id8ZnTl6eWb3b5pY/ZLdXI7OfwqkeDczsk68Ho9NNzOL7div3a3uv2z/lrx6iZfibGQAAAABJRU5ErkJggg==)";
}
  //The line below is closing the whole function
})();