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.

目前为 2021-03-05 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Find The Correct Watch Order And All Related Entries+Live-Actions+Doramas + Copy Entry Title
  3. // @namespace Search for Live-Actions\Doramas\All Related Entries + Correct Watch Order + Copy Entry Title
  4. // @version 2.0.0.20
  5. // @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.
  6. // @author hacker09
  7. // @include https://myanimelist.net/forum/?topicid=1863965
  8. // @include https://myanimelist.net/forum/?topicid=1890672
  9. // @include /^https:\/\/myanimelist\.net\/anime\/[\d]+(\/.*)?/
  10. // @include /^https:\/\/myanimelist\.net\/manga\/[\d]+(\/.*)?/
  11. // @icon https://www.google.com/s2/favicons?domain=myanimelist.net
  12. // @run-at document-end
  13. // @grant none
  14. // ==/UserScript==
  15.  
  16. //The lines below are the beginning of the function
  17. (function() {
  18. 'use strict';
  19. if (location.href === 'https://myanimelist.net/forum/?topicid=1890672') //If the user is on the Tampermonkey Guide Index
  20. { //Starts the if condition
  21. if (document.querySelector("a.header-profile-link").innerText === 'hacker09' || '_cjessop19_') //Check the script user MAL username
  22. { //Starts the if condition
  23. $("b:contains('Guides available:')")[0].insertAdjacentHTML('afterEnd', '<div style="cursor: pointer;"><b>Guides available:</b><br><b id="IncorrectlyAddedStep1">Step 1: Click here to check for anime ids that were incorrectly added.</b><br><br><b id="CheckForMissingLinksStep2"> Step 2: Click here to check for anime entries that the tampermonkey guide index is missing</b><br></div>'); //Add 3 clickable texts below the Tampermonkey Guide Index "Guides available" text
  24.  
  25. $("b:contains('Guides available:')")[0].innerText = ''; //Remove the default "Guides available" text
  26.  
  27. document.querySelector("#IncorrectlyAddedStep1").onclick = function() { //Detects the mouse click on the Step 1 text and starts the function to Check For Missing Links
  28. var IncorrectlyAddedAnimeIDs = document.querySelector("div.clearfix.word-break").firstChild.innerText.match(/\| \d+ ?\||\|\d+ \|/gi); //Gets all the anime ids that were added incorrectly
  29. if (IncorrectlyAddedAnimeIDs === null) //If there's no anime ids that were added incorrectly
  30. { //Starts the if condition
  31. document.querySelector("#IncorrectlyAddedStep1").innerText = document.querySelector("#IncorrectlyAddedStep1").innerText + '\n' + "Done! There's no anime ids to be fixed! You may now Click on Step 2 if wanted."; //Shows a message
  32. } //Finishes the if condition
  33. else { //Starts the else condition
  34. document.querySelector("#IncorrectlyAddedStep1").innerText = document.querySelector("#IncorrectlyAddedStep1").innerText + '\nYou must fix these anime ids before clicking on step 2!\n' + IncorrectlyAddedAnimeIDs; //Add a text to the end of the IncorrectlyAdded text and add the anime ids that were incorrectly added when the process is finished
  35. } //Finishes the else condition
  36. }; //Finishes the IncorrectlyAdded onclick function
  37.  
  38. document.querySelector("#CheckForMissingLinksStep2").onclick = function() { //Detects the mouse click on the Step 2 text and starts the function to Check For Missing Links
  39. var ChiakiIDSArray = []; //Creates a new blank global array
  40. var GuideIndexIDS = []; //Creates a new blank global array
  41. var GuideIndexIDSmatches = document.querySelector("div.clearfix.word-break").firstChild.innerText.match(/(?:\|\b\d+)/gi); //Creates a new variable to hold the whole text of the first post on the topic
  42. var match; //Creates a new blank variable
  43. for (match in GuideIndexIDSmatches) //For every anime id existent on the GuideIndexIDSmatches text content
  44. { //Starts the for condition
  45. GuideIndexIDS.push(GuideIndexIDSmatches[match].replace(/(?:\|)/gi, '')); //Remove the first | symbol in front of the anime id numbers
  46. } //Finishes the for condition
  47. document.querySelector("#CheckForMissingLinksStep2").innerText = document.querySelector("#CheckForMissingLinksStep2").innerText + '\nFinished getting all anime ids on this page!\n'; //Add a text to the end of the Step 2 text when the process is finished
  48.  
  49. async function GetChiakiIDS() { //Creates a new function
  50. while (true) { //While the if condition returns true
  51. var match; //Creates a new blank variable
  52. var matches = document.querySelector("div.clearfix.word-break").firstChild.innerText.match(/(?:\|\b\d+)/gi); //Get all the anime ids on the MAL page
  53. for (match in matches) //For all anime ids on the MAL page
  54. { //Starts the for condition
  55. var FetchChiaki = matches[match].replace(/(?:\|)/gi, ' https://api.allorigins.win/raw?url=https://chiaki.site/?/tools/watch_order/id/'); //Creates a variable to fetch chiaki.site
  56. const html = await (await fetch(FetchChiaki)).text(); //Gets the fetch response
  57. var ChiakiDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response
  58.  
  59. for (const ChiakiAnimeIDS of ChiakiDocument.querySelectorAll('span.uk-text-muted.uk-text-small > a')) { //For every anime entry links existent on the chiaki.site
  60. ChiakiIDSArray.push(ChiakiAnimeIDS.href.match(/\d+/)[0]); //Get only the anime id of every anime entry links existent on the chiaki.site
  61. } //Finishes the for condition
  62. } //Finishes the for condition
  63. if (ChiakiDocument.body.innerText.search('Watch') > -1) { //If the text Watch was found on the chiaki.site document
  64. document.querySelector("#CheckForMissingLinksStep2").innerText = document.querySelector("#CheckForMissingLinksStep2").innerText + ' Finished fetching chiaki!\n'; //Add a text to the end of the Step 2 text when the process is finished
  65.  
  66. var FinalArray = ChiakiIDSArray.filter(d => !GuideIndexIDS.includes(d)); //Get the ids that chiaki.site has and the Guide is missing
  67. if (FinalArray.length === 0) //If there's no missing entries on the tampermonkey guide index
  68. { //Starts the if condition
  69. document.querySelector("#CheckForMissingLinksStep2").innerText = document.querySelector("#CheckForMissingLinksStep2").innerText + ' Finished comparing the anime ids on this page with all the anime ids that chiaki.site has!\nThe Tampermonkey Guide has missing entries!\n'; //Add a text to the end of the Step 2 text when the process is finished
  70. } //Finishes the if condition
  71. else //If the tampermonkey guide index has missing entries
  72. { //Starts the else condition
  73. var GuideMissingIds = document.createElement("div"); //Creates a div element
  74. FinalArray.forEach(function(AnimeID) { //For every anime id that the guide index is missing
  75. GuideMissingIds.innerHTML += GuideMissingIds.innerHTML = '<br><a href="' + `https://myanimelist.net/anime/${AnimeID}` + '">' + `https://myanimelist.net/anime/${AnimeID}` + '</a>'; //Add to the GuideMissingIds div a line break + the anime link with the link as text too
  76. }); //Finishes the foreach condition
  77.  
  78. document.querySelector("#CheckForMissingLinksStep2").innerText = document.querySelector("#CheckForMissingLinksStep2").innerText + ' Finished comparing the anime ids on this page with all the anime ids that chiaki.site has!\nYou can see which entries are missing in the Tampermonkey Guide below:\n'; //Add a text to the end of the Step 2 text when the process is finished
  79. document.querySelector("#CheckForMissingLinksStep2").appendChild(GuideMissingIds); //Shows the links that the Tampermonkey Guide Index is missing
  80. } //Finishes the else condition
  81. return; //Return true
  82. } //Finishes the if condition
  83. await new Promise(resolve => setTimeout(resolve, 1000)); //Wait 1 sec before fetching chiaki.site again
  84. } //Finishes the while condition
  85. } //Finishes the async GetChiakiIDS function
  86. GetChiakiIDS(); //Starts the async GetChiakiIDS function
  87. }; //Finishes the Step 2 onclick function
  88. } //Finishes the if condition
  89.  
  90. } //Finishes the if condition //***************************************************************************************************************************************************************************
  91. if (location.href === 'https://myanimelist.net/forum/?topicid=1863965') //If the user is on the Official Guidex Index
  92. { //Starts the if condition
  93.  
  94. $("b:contains('Guides available:')")[0].insertAdjacentHTML('afterEnd', '(Click on the letter you want to jump to.)<br><div style="cursor: pointer;"><b id="GoToA">Guides available: A</b> | <b id="GoToB">B</b> | <b id="GoToC">C</b> | <b id="GoToD">D</b> | <b id="GoToE">E</b> | <b id="GoToF">F</b> | <b id="GoToG">G</b> | <b id="GoToH">H</b> | <b id="GoToI">I</b> | <b id="GoToJ">J</b> | <b id="GoToK">K</b> | <b id="GoToL">L</b> | <b id="GoToM">M</b> | <b id="GoToN">N</b> | <b id="GoToO">O</b> | <b id="GoToP">P</b> | <b id="GoToQ">Q</b> | <b id="GoToR">R</b> | <b id="GoToS">S</b> | <b id="GoToT">T</b> | <b id="GoToU">U</b> | <b id="GoToV">V</b> | <b id="GoToW">W</b> | <b id="GoToX">X</b> | <b id="GoToY">Y</b> | <b id="GoToZ">Z</b><div>'); //Add some information and the clickable letter to the "Guide Index" text
  95.  
  96. $("b:contains('Guides available:')")[0].innerText = ''; //Remove the default "Guide Index" text
  97.  
  98. var start = 'A'.charCodeAt(0); //Create a new variable
  99. var last = 'Z'.charCodeAt(0); //Create a new variable
  100. for (let i = start; i <= last; ++i) { //For every charCode
  101. var letter = String.fromCharCode(i); //Get the letter
  102. document.querySelector("b#GoTo" + letter).onclick = function() { //Detects the mouse click on the letter and starts the function to jump to this letter
  103. document.querySelectorAll("b")[i - 37].scrollIntoView(); //Scroll the page until the letter can be seen
  104. }; //Finishes the function
  105. } //Finishes the for condition
  106. //***************************************************************************************************************************************************************************
  107. // When the user scrolls down 20px from the top of the document, show the button
  108. window.onscroll = function() { //Run this function every time the user scrolls the page
  109. if (document.documentElement.scrollTop > 250) { //If the page was scrolled a lit bit down
  110. document.querySelector("#topBtn").style.display = "block"; //Show the go to top button
  111. } else { //If the page was not scrolled down
  112. document.querySelector("#topBtn").style.display = "none"; //Hide the go to top button
  113. } //Finishes the else condition
  114. }; //Finishes the onscroll advent listener
  115. document.body.insertAdjacentHTML("afterend", '<style>#topBtn {display: none;position: fixed;bottom: 20px;right: 30px;z-index: 99;font-size: 18px;border: none;outline: none;background-color: #2e51a2;color: white;cursor: pointer;padding: 15px;border-radius: 4px;}</style><button onclick="document.documentElement.scrollTop = 0;" id="topBtn" title="Go to top" style="transform: rotate(90deg); display: none;">&lt;</button>'); //Adds the scroll up button to the page
  116. } //Finishes the if condition //***************************************************************************************************************************************************************************
  117. if (location.href !== 'https://myanimelist.net/forum/?topicid=1863965' || 'https://myanimelist.net/forum/?topicid=1890672') //If the user isn't on any Guide Index
  118. { //Starts the if condition
  119. var AllChiakiAnimeTitles = []; //Creates a new blank array
  120. var titleElem = document.querySelector("[itemprop*='name']"); //Select the entry title element
  121. var titleText = titleElem.innerText.split('\n')[0]; //Select the entry romaji title text
  122. var findButton = document.createElement("a"); //Creates an "a" element to show a button later
  123. var copyButton = document.createElement("a"); //Creates an "a" element so the button will appear
  124. var chiakiButton = document.createElement("a"); //Creates an "a" element so the button will appear
  125. var animeid = location.pathname.match(/\d+/)[0]; //Get the anime id to add on the chiaki website url
  126. var ChiakiAnimeTitle, ChiakiAnimeTitleWithSymbols, Chiaki_Anime_Franchise_TV_Title_With_Symbols, Chiaki_Anime_Franchise_TV_Title, response2, html2, MyDramaListDocument, response3, html3, AsianWikiDocument, MyDramaListText, AsianWikiText, MyDramaListCheck, AsianWikiCheck, MalClubText, ChiakiDocument, FranchiseHasTVType, Websites, LineBeak, Space, AnimeLinks; //Make these variables global
  127.  
  128. if (document.querySelector("a.header-profile-link") !== null) { //Check the script user MAL username
  129. if (document.querySelector("a.header-profile-link").innerText === 'alshu') { //Check the script user MAL username
  130. return; //Make the script not work
  131. } //Finishes the if condition
  132. } //Finishes the if condition
  133.  
  134. if (document.querySelector(".title-name") !== null) //On anime pages ".title-name" usually exists. If this element exists
  135. { //Starts the if condition
  136. titleElem = document.querySelector(".title-name"); //Select the entry title element
  137. titleText = document.querySelector(".title-name").textContent; //Select the entry title text
  138. } //Finishes the if condition
  139. if (document.querySelector(".title-english") !== null && document.querySelector(".title-name") === null) //On manga pages ".title-name" usually doesn't exists
  140. { //Starts the if condition
  141. var SaveEngTitle = document.querySelector(".title-english").innerText; //Save the english title to a variable
  142. document.querySelector("[itemprop*='name']").firstElementChild.remove(); //Remove Line Break <br>
  143. document.querySelector(".title-english").remove(); //Remove the Eng title
  144. setTimeout(function() { //Starts the setTimeout
  145. titleElem.insertAdjacentHTML('beforeend', '<br><span class="title-english">' + SaveEngTitle + '</span>'); //ReAdd the english title and line break to the page when the script finishes
  146. }, 0); //Finishes the setTimeout
  147. } //Finishes the if condition
  148.  
  149. copyButton.addEventListener("click", () => {
  150. navigator.clipboard.writeText(titleText); //Copy the entry title with symbols
  151. }); //Detect the single mouse click
  152. copyButton.addEventListener("dblclick", () => {
  153. navigator.clipboard.writeText(titleText.replace(/[^a-zA-Z0-9]+/g, " ")); //Copy the entry title without symbols
  154. }); //Detect the double mouse click
  155. copyButton.setAttribute("title", "1 Click To Copy Entry Title (+ Symbols)\n2 Clicks To Copy Entry Title (Without Symbols)"); //Detects a mouse hover on the button and shows a explanation text
  156. 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 CSS for the copy button
  157. titleElem.appendChild(copyButton); //Append the button close to the title element
  158. 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)"; //The copy button image converted to DATA URI
  159. //********************************************************************************************************************************************************************
  160. if (window.location.pathname.split('/')[1] === 'anime') // Show the buttons to search for adaptations, and the chiaki site button only if the user is in an anime entry
  161. { //Starts the if function
  162. var Array2 = []; //Creates a new blank array
  163. var ChiakiAnimeIDSArray = []; //Creates a new blank array
  164.  
  165. async function GetAnimeTitle() //Creates a function to Process and Get the Anime Title
  166. { //Starts the function
  167. const response = await fetch('https://api.allorigins.win/raw?url=https://chiaki.site/?/tools/watch_order/id/' + animeid); //Fetch
  168. const html = await response.text(); //Gets the fetch response
  169. ChiakiDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response
  170. ChiakiAnimeTitle = ChiakiDocument.querySelector("h2").innerText.split(' Watch Order')[0].replace(/[^a-zA-Z0-9]+/g, " ").trim(); //Get the anime title on the h2 element and remove the Watch Order text, and remove any symbols that the title might have, also removes the first and last whitespaces if existent
  171. ChiakiAnimeTitleWithSymbols = ChiakiDocument.querySelector("h2").innerText.split(' Watch Order')[0].trim(); //Get the anime title on the h2 element (with symbols) and remove the Watch Order text, also removes the first and last whitespaces if existent
  172. Array.from(ChiakiDocument.querySelectorAll("span.wo_title")).forEach(link => AllChiakiAnimeTitles.push(link.innerText)); //Add all anime titles of the anime franchise to the array AllChiakiAnimeTitles
  173. FranchiseHasTVType = false; //Define the variable as false
  174. if ([...ChiakiDocument.querySelectorAll('span.uk-text-muted.uk-text-small')].find(e => e.innerText.includes('TV'))) { //Starts the if condition
  175. FranchiseHasTVType = true; //Define the variable as true
  176. Chiaki_Anime_Franchise_TV_Title_With_Symbols = [...ChiakiDocument.querySelectorAll('span.uk-text-muted.uk-text-small')].find(e => e.innerText.includes('TV')).parentElement.querySelector("span.wo_title").innerText; //Add the first tv type Chiaki Anime Title with symbols to a variable
  177. Chiaki_Anime_Franchise_TV_Title = Chiaki_Anime_Franchise_TV_Title_With_Symbols.replace(/[^a-zA-Z0-9]+/g, " "); //Remove any symbols that the title might have
  178. if (ChiakiAnimeTitle.match('Watch Order') !== null) //If the h2 element on chiaki.site doesn't have the anime title
  179. { //Starts the if condition
  180. ChiakiAnimeTitle = Chiaki_Anime_Franchise_TV_Title; //Replace the variable ChiakiAnimeTitle contents with the variable Chiaki_Anime_Franchise_TV_Title
  181. ChiakiAnimeTitleWithSymbols = Chiaki_Anime_Franchise_TV_Title_With_Symbols; //Replace the variable ChiakiAnimeTitleWithSymbols contents with the variable Chiaki_Anime_Franchise_TV_Title_With_Symbols contents
  182. } //Finishes the if condition
  183. } //Finishes the if condition
  184.  
  185. response2 = await fetch("https://api.allorigins.win/raw?url=https://mydramalist.com/search?q=" + ChiakiAnimeTitle); //Fetch
  186. html2 = await response2.text(); //Gets the fetch response
  187. MyDramaListDocument = new DOMParser().parseFromString(html2, 'text/html'); //Parses the fetch response
  188.  
  189. if (MyDramaListDocument.body.innerText.search(' found for: ') > -1) //If MyDramaList returned any results
  190. { //Starts the if condition
  191. MyDramaListText = '\nMyDramaList'; //Display to the user that MyDramaList website will be opened if Ok is clicked
  192. MyDramaListCheck = '👍 Found on MyDramaList.'; //Display the confirmation that the anime has adaptations found on MyDramaList
  193. } //Finishes the if condition
  194. else { //Starts the else condition
  195. MyDramaListText = ''; //Display to the user that MyDramaList Won't be opened if Ok is clicked
  196. MyDramaListCheck = '✖ NOT Found on MyDramaList.'; //Display the confirmation that the anime doesn't have any adaptations found on MyDramaList
  197. } //Finishes the else condition
  198.  
  199. response3 = await fetch("https://api.allorigins.win/raw?url=https://asianwiki.com/Special:Search/" + ChiakiAnimeTitle); //
  200. html3 = await response3.text(); //Gets the fetch response
  201. AsianWikiDocument = new DOMParser().parseFromString(html3, 'text/html'); //Parses the fetch response
  202.  
  203. if (AsianWikiDocument.body.innerText.search('There were no results matching the query.') > -1) //If AsianWiki didn't return any results
  204. { //Starts the if condition
  205. AsianWikiText = ''; //Display to the user that AsianWiki Won't be opened if Ok is clicked
  206. AsianWikiCheck = '✖ NOT Found on AsianWiki.'; //Display the confirmation that the anime doesn't have any adaptations found on AsianWiki
  207. } //Finishes the if condition
  208. else { //Starts the else condition
  209. AsianWikiText = '\nAsianWiki'; //Display to the user that AsianWiki website will be opened if Ok is clicked
  210. AsianWikiCheck = '👍 Found on AsianWiki.'; //Display the confirmation that the anime has adaptations found on AsianWiki
  211. } //Finishes the else condition
  212.  
  213. Websites = ''; //Creates a new blank variable
  214. LineBeak = ''; //Creates a new blank variable
  215. Space = ' '; //Creates a variable to add spaces to the text
  216. if (MyDramaListCheck.match('NOT') === null || AsianWikiCheck.match('NOT') === null) //If AsianWiki or MyDramaList returned any results
  217. { //Starts the if condition
  218. Websites = ' the following websites:\n'; //Display a message in plural
  219. LineBeak = '\n'; //Creates a variable to add Line Breaks to the text
  220. Space = ''; //Creates a new blank variable
  221. } //Finishes the if condition
  222. //*************************************************************************************************************************************************
  223. var TextElement = ChiakiDocument.querySelectorAll("span.uk-text-muted.uk-text-small"); //Creates a variable to loop though the elements after
  224. for (var i = 0; i < TextElement.length; i++) { //Starts the for condition
  225.  
  226. AnimeLinks = ChiakiDocument.querySelectorAll("span.uk-text-muted.uk-text-small > a")[i].href.match(/\d+/)[0]; //Store the anime links in a variable
  227. ChiakiAnimeIDSArray.push(AnimeLinks); //Add All Anime Links on chiaki to an Array
  228.  
  229. var TotalRawDuration = TextElement[i].textContent.split("×")[1].split("|")[0].trim(); //Creates a variable to hold the total unprocessed times
  230. var ALLChiakiTitles = ChiakiDocument.querySelectorAll("span.wo_title")[i].innerText; //Creates a variable to get all the anime titles on chiaki site
  231. var TotalEpisodes = TextElement[i].textContent.split("|")[2].match(/\d+|\?/g)[0]; //Creates a variable to hold the total episodes
  232. var EpisodeType = TextElement[i].textContent.split("|")[1].trim(); //Creates a variable to get the episode types
  233. var eps = ' eps'; //Create a variable called eps
  234. var Duration = ''; //Creates a blank variable
  235. var PerEp = ' per ep'; //Create a variable called PerEp
  236. if (TotalEpisodes === '1') { //If the entry has only 1 ep
  237. var eps = ' ' + EpisodeType; //Change the variable called eps
  238. var PerEp = ''; //Change the variable called PerEp
  239. } //Finishes the if condition
  240. if (EpisodeType !== 'TV') { //If the entry type isn't TV
  241. if (TotalEpisodes !== '1') { //If the entry doesn't have only 1 ep
  242. var eps = ' ' + EpisodeType + 's'; //Change the variable called eps
  243. } //Finishes the if condition
  244. var Duration = ' of ' + TotalRawDuration + PerEp; //Defines the Duration variable if the episode type isn't TV
  245. } //Finishes the if condition
  246. Array2.push(ALLChiakiTitles + ',, ' + TotalEpisodes + eps + Duration + ',' + '\n'); //Add Everything to an Array
  247. } //Finishes the for condition
  248. } //Finishes the async function
  249. GetAnimeTitle(); //Call the GetAnimeTitle function
  250.  
  251. copyButton.addEventListener("contextmenu", (e) => {
  252. navigator.clipboard.writeText(Array2.join('').trim()); //Copy the array to the clipboard
  253. e.preventDefault(); //Don't show the right click default contextmenu
  254. }); //Detect the mouse right click
  255. copyButton.setAttribute("title", "1 Click To Copy Entry Title (+ Symbols)\n2 Clicks To Copy Entry Title (Without Symbols)\n\nRight click to Copy ALL Entry Titles In The Correct Watch Order With EP Numbers, Duration Times and Entry Types"); //Detects a mouse hover on the button and shows a explanation text
  256.  
  257. findButton.addEventListener("click", () => { //Detect the mouse click and search for the anime title
  258. async function CheckWithAMALClub() //Creates a function to Check With A MAL Club
  259. { //Starts the function
  260. if (FranchiseHasTVType === true) //If the Franchise has at least 1 entry that the type is TV
  261. { //Starts the if condition
  262. const response = await fetch('https://myanimelist.net/clubs.php?cid=5450'); //Fetch
  263. const html = await response.text(); //Gets the fetch response
  264. const newDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response
  265.  
  266. newDocument.body.innerText.search(ChiakiAnimeTitleWithSymbols) > -1 ? MalClubText = '👍 Found on this MAL Club bit.ly/38KZxwH' : MalClubText = '✖ NOT found on this MAL Club bit.ly/38KZxwH'; //If the title is found on the MALClub, display the confirmation whether or not the anime has adaptations found on the MALClub
  267.  
  268. if (confirm('Franchise Title: ' + ChiakiAnimeTitle + '\n\n' + MyDramaListCheck + '\n' + MalClubText + '\n' + AsianWikiCheck + '\n\nDo you want to open' + Websites + Space + 'IMDB' + AsianWikiText + MyDramaListText + LineBeak + Space + 'to confirm that information and get more detailed info?')) //Show the confimation alert box text
  269. { //Starts the if condition
  270. window.open("https://www.imdb.com/find?q=" + ChiakiAnimeTitle + "&s=tt&ref_=fn_al_tt_mr", "_blank"); //Open IMDB on a new tab
  271. if (MyDramaListCheck.match('NOT') === null) {
  272. window.open("https://mydramalist.com/search?q=" + ChiakiAnimeTitle, "_blank"); //Open MyDramaList on a new tab
  273. } //Open MyDramaList on a new tab only if any results were found on the website
  274. if (AsianWikiCheck.match('NOT') === null) { //Open AsianWiki on a new tab
  275. window.open("http://asianwiki.com/index.php?title=Special%3ASearch&search=" + ChiakiAnimeTitle, "_blank"); //Open AsianWiki on a new tab
  276. } //Open AsianWiki on a new tab only if any results were found on the website
  277. } //Finishes the if condition
  278. } //Finishes the if condition
  279. else //If the anime doesn't have any entry type = TV
  280. { //Starts the else condition
  281. alert("This Franchise doesn't even have any TV type entries, it's very likely that there's no adaptations of any kind for this Franchise, so there's no need to search."); //Show a message to the user
  282. } //Finishes the else condition
  283. } //Finishes the async function
  284. CheckWithAMALClub(); //Calls the function CheckWithAMALClub
  285. }); //Finishes the advent listener
  286. findButton.setAttribute("title", "Search for Live-Actions/Doramas"); //Detects a mouse hover on the button and show the text Find Live-Actions
  287. 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 CSS for the findButton
  288. titleElem.appendChild(findButton); //Append the button close to the title element
  289. 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 find button image converted to DATA URI
  290. //********************************************************************************************************************************************************************
  291. chiakiButton.addEventListener('mousedown', function(e) { //Detects when the user middle clicks on the chiakiButton
  292. if (e.button === 1) { //Starts the if condition If the middle mouse button was clicked
  293. (async () => { //Creates a function to check if the guide index has this anime watch order and Starts the function
  294. const response = await (await fetch('https://myanimelist.net/forum/?topicid=1890672')).text(); //Fetch
  295. const GuideIndexnewDocument = new DOMParser().parseFromString(response, 'text/html'); //Parses the fetch response
  296. var GuideIndexLinkElement = [...GuideIndexnewDocument.querySelectorAll('b')].find(e => e.innerText.includes('|' + animeid + '|')); //Gets the topic element that probably has the link of the Franchise and adds that to a variable
  297.  
  298. if (GuideIndexLinkElement !== undefined) //If the anime id was found on the guide index
  299. { //Starts the if condition
  300. if (GuideIndexLinkElement.previousElementSibling.innerText.match('あ') !== null) //If the anime name has the あ symbol in it on the guide index
  301. { //Starts the if condition
  302. alert('Recommended watch order:\nBroadcast order.'); //Shows an alert
  303. } //Finishes the if condition
  304. else //If the anime name doesn't have the あ symbol in it on the guide index
  305. { //Starts the if condition
  306. alert('Recommended watch order:\nAEGC Guide Order.'); //Shows a text
  307. } //Finishes the if condition
  308. window.open(GuideIndexLinkElement.previousElementSibling.href, "_blank"); //Opens the GuideIndexLink on a new tab, and specifies that the GuideIndexLink should be opened on a new tab
  309. } //Finishes the if condition
  310. else //If the anime id was NOT found on the guide index
  311. { //Starts the else condition
  312. var NotFoundMessage = document.createElement("a"); //Creates an a element
  313. NotFoundMessage.innerHTML = "<br>Not found on the AEGC Club!<br>Only chiaki.site will be opened.<br>"; //Defines the element text
  314. NotFoundMessage.setAttribute("style", "font-size: 80%;text-decoration: none;"); //Set the css for the button
  315. titleElem.appendChild(NotFoundMessage); //Append the NotFoundMessage close to the title element
  316. setTimeout(function() {
  317. window.open("https://chiaki.site/?/tools/watch_order/id/" + animeid, "_blank");
  318. }, 1000); //Opens chiaki.site on a new tab to show all the related anime entries on MAL on the correct watch order for the anime franchise and specifies that chiaki.site should be opened on a new tab
  319. } //Finishes the else condition
  320.  
  321. var GuideIndexIDSmatches = GuideIndexnewDocument.querySelector("div.clearfix.word-break").firstChild.innerText.match(/(?:\|\b\d+)/gi); //Creates a new variable to hold the whole text of the first post on the topic
  322. var GuideIndexIDS = []; //Creates a new blank array
  323. var match; //Creates a new blank variable
  324. for (match in GuideIndexIDSmatches) //For every anime id existent on the GuideIndexIDSmatches text content
  325. { //Starts the for condition
  326. GuideIndexIDS.push(GuideIndexIDSmatches[match].replace(/(?:\|)/gi, '')); //Remove the first | symbol in front of the anime id numbers
  327. } //Finishes the for condition
  328. var FinalArray = ChiakiAnimeIDSArray.filter(d => !GuideIndexIDS.includes(d)); //Get the ids that chiaki.site has and the Guide is missing
  329. var GuideMissingIds = document.createElement("div"); //Creates a div element
  330. GuideMissingIds.setAttribute("style", "font-size: 80%;display: none;"); //Set the css for the button
  331. FinalArray.forEach(function(AnimeID) { //For every anime id that the guide index is missing
  332. GuideMissingIds.innerHTML += GuideMissingIds.innerHTML = '<br><a href="' + `https://myanimelist.net/anime/${AnimeID}` + '">' + `https://myanimelist.net/anime/${AnimeID}` + '</a>'; //Add to the GuideMissingIds div a line break + the anime link with the link as text too
  333. }); //Finishes the foreach condition
  334.  
  335. if (FinalArray.length !== 0) //If there's at least 1 missing id on the guide index
  336. { //Starts the if condition
  337. var LinksButton = document.createElement("button"); //Creates a button element
  338. LinksButton.innerHTML = 'Show AEGC Club Missing Links'; //Defines the element text
  339. LinksButton.setAttribute("style", "margin-left: 10px;"); //Set the css for the button
  340. LinksButton.onclick = function() { //Detects the mouse click on the Show Links Button
  341. if (GuideMissingIds.style.display === "none") { //If the Show missing links button is hidden
  342. GuideMissingIds.style.display = ''; //Show the missing links button
  343. LinksButton.innerHTML = 'Hide AEGC Club Missing Links'; //Defines the element text
  344. } else { //If the Show missing links button is being shown
  345. GuideMissingIds.style.display = "none"; //Hide the missing links button
  346. LinksButton.innerHTML = 'Show AEGC Club Missing Links'; //Defines the element text
  347. } //Finishes the else condition
  348. }; //FInishes the onclick advent listener
  349. titleElem.appendChild(LinksButton); //Display the button to show the ids that chiaki.site has and the Guide is missing
  350. titleElem.appendChild(GuideMissingIds); //Display the ids that chiaki.site has and the Guide is missing
  351. } //Finishes the if condition
  352.  
  353. if (FinalArray.length === ChiakiAnimeIDSArray.length) //If the guide index is missing the exact same amount of total links that chiaki has for the franchise
  354. { //Starts the if condition
  355. LinksButton.remove(); //Remove the button that shows the missing links
  356. } //Finishes the if condition
  357.  
  358. if (GuideIndexLinkElement !== undefined && FinalArray.length === ChiakiAnimeIDSArray.length - 1) //If the anime id was found on the guide index and the missing links is equal all of the chiaki.site total links -1
  359. { //Starts the if condition
  360. LinksButton.remove(); //Remove the button that shows the missing links
  361. var TwoFranchises = document.createElement("a"); //Creates an a element
  362. TwoFranchises.innerHTML = "<br>It seems that this entry is related to 2 Anime Franchises.<br>Both chiaki.site and the AEGC Club will be opened."; //Defines the element text
  363. TwoFranchises.setAttribute("style", "font-size: 80%;text-decoration: none;"); //Set the css for the button
  364. titleElem.appendChild(TwoFranchises); //Append the NotFoundMessage close to the title element
  365.  
  366. window.open("https://chiaki.site/?/tools/watch_order/id/" + animeid, "_blank"); //Opens chiaki.site on a new tab to show all the related anime entries on MAL on the correct watch order for the anime franchise and specifies that chiaki.site should be opened on a new tab
  367. } //Finishes the if condition
  368.  
  369. var TimesExecuted = 0; //Creates a new variable
  370. var increaseby = 1; //Creates a new variable
  371.  
  372. for (var i = 0; i < GuideIndexIDSmatches.length; i++) { //Loop through all the anime ids on the tampermonkey guide page
  373. if (GuideIndexIDSmatches[i].match(animeid)) //If 2 identical anime ids were found on the tampermonkey guide index
  374. { //Starts the if condition
  375. TimesExecuted += increaseby; //Sum the amount of times that the page was scrolled
  376.  
  377. if (TimesExecuted > 1) //If more than 1 identical anime ids were found on the tampermonkey guide index
  378. { //Starts the if condition
  379. var OtherFranchiseMessage = document.createElement("a"); //Creates an a element
  380. OtherFranchiseMessage.innerHTML = "<br>According to the AEGC club this entry also has another related entry that chiaki.site consider as being from another franchise."; //Defines the element text
  381. OtherFranchiseMessage.setAttribute("style", "font-size: 80%;text-decoration: none;"); //Set the css for the button
  382. titleElem.appendChild(OtherFranchiseMessage); //Append the OtherFranchiseMessage close to the title element
  383. break; //After the duplicated anime id of the franchise was found stop the for loop condition
  384. } //Finishes the if condition
  385.  
  386. } //Finishes the if condition
  387.  
  388. } //Finishes the for loop condition
  389.  
  390. })(); //Finishes the async function
  391.  
  392. e.preventDefault(); //Prevent the default middle button action from executing
  393. } //Finishes the if condition
  394. }); //Finishes the mousedown advent listener
  395.  
  396. var MangaOnlyFranchise = false; //Creates a new global variable
  397. } //Finishes the if condition
  398.  
  399. chiakiButton.setAttribute("title", "Click to Find Related Entries + Correct Watch Order\nMiddle Click to to Find Related Entries + Correct Watch Order on chiaki.site and on the AEGC Club\nRight Click to Find Related Entries + Correct Watch Order. (Including mangas,one shot's, Light Novels etc...)"); //Detects a mouse hover on the button and shows some text info
  400. chiakiButton.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 CSS for the chiakiButton
  401. chiakiButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAeFBMVEUAAADfceLecePYcefycdTMcfHZcefPce7tcdfQce3tcdffceLQce3tcdfeceLmcdziceDycdPLcfDYceflcd3KcfHycdPzcdPUce3tcdricePxtPDlkev0w/Pjg+ftf97ae+v10fboqvLvourvm+ftieHkm+/ah+6xZFdBAAAAGHRSTlMAFypl7u3s3t21tYlzc/Dv6MPCwsKJiWWHdugpAAAA1klEQVQY013Q2XLCMAwFUMehCQkJe4sW2wlZyv//YWVVzAD3yT5zNV6cxndNDVA3nXfPFOX5CzTVpSzMvpWMd8WHERDtVUs1U8mxlDPOLz3N1bvuvziOMIZAKREeetcAPCZmDpAip3kZCFtXg1Q4hpHCPXKcecCtk9HfKd6nKaWMLIgZH7kZkjRlIYYynrtMRIGXNfKCMt4YSuZZWMZb11UAlJIYDuuKOOCmd/5id8ZnTl6eWb3b5pY/ZLdXI7OfwqkeDczsk68Ho9NNzOL7div3a3uv2z/lrx6iZfibGQAAAABJRU5ErkJggg==)"; //The chiaki.site button favicon converted to DATA URI
  402.  
  403.  
  404. if (window.location.pathname.split('/')[1] === 'manga') //If the user is in an manga entry
  405. { //Starts the if function
  406. if (document.querySelector("table.anime_detail_related_anime") === null) { //Starts the if condition
  407. var AnimeLinks = document.getElementsByTagName('a'); //Creates a variable to hold all links elements on the page
  408. } //Finishes the if condition
  409. else //If the opened page has any Alternative versions:, Spin-offs:, Adaptations: or Other: links elements on the page
  410. { //Starts the else condition
  411. AnimeLinks = document.querySelector("table.anime_detail_related_anime").querySelectorAll('a'); //Creates a variable to hold all Alternative versions:, Spin-offs:, Adaptations: and Other: links elements on the page
  412. } //Finishes the else condition
  413.  
  414. MangaOnlyFranchise = true; //If the actual loaded page is manga let's consider the franchise as if it didn't have any anime adaptations
  415. for (var i = 0; i < AnimeLinks.length; i++) { //Loop through all links elements on the page
  416. if (AnimeLinks[i].href.match(/^https:\/\/myanimelist\.net\/anime\/[\d]+(\/.*)?/) !== null) //If the link is anime
  417. { //Starts the if condition
  418. animeid = AnimeLinks[i].href.match(/\d+/)[0]; //Try to get 1 anime id of the franchise
  419. MangaOnlyFranchise = false; //If the script found 1 anime id for the franchise change the variable to true
  420. break; //After the first anime id of the franchise was found stop the for loop condition
  421. } //Finishes the if condition
  422. } //Finishes the for loop condition
  423.  
  424. } //Finishes the if condition
  425.  
  426. if (MangaOnlyFranchise === false) //If the manga entry HAS anime entries on MAL
  427. { //Starts the if function
  428. chiakiButton.addEventListener("click", (e) => { //Detect the mouse click
  429. window.open("https://chiaki.site/?/tools/watch_order/id/" + animeid, "_blank"); //Opens chiaki.site on a new tab to show all the related anime entries on MAL on the correct watch order for the anime franchise and specifies that chiaki.site should be opened on a new tab
  430. }); //Finishes the addEventListener click
  431.  
  432. chiakiButton.addEventListener("contextmenu", (e) => {
  433. window.open("http://www.relatedanime.com/anime/" + animeid, "_blank"); //Open relatedanime.com on a new tab to show all the related anime entries on MAL on the correct watch order for the anime franchise, including mangas,one shot's, Light Novels and these things...
  434. e.preventDefault(); //Don't show the right click default contextmenu
  435. }); //Detect the mouse right click
  436.  
  437. chiakiButton.setAttribute("title", "Click to Find Related Entries + Correct Watch Order\nRight Click to Find Related Entries + Correct Watch Order. (Including mangas,one shot's, Light Novels etc...)"); //Detects a mouse hover on the button and shows some text info
  438.  
  439. } //Finishes the if condition
  440.  
  441. if (MangaOnlyFranchise === true) //If the manga entry has NO anime entries on MAL
  442. { //Starts the if function
  443. chiakiButton.addEventListener("click", (e) => { //Detect the mouse click
  444. window.open("http://www.relatedanime.com/manga/" + animeid, "_blank"); //Detects the mouse click, and Open relatedanime.com on a new tab to show all the related anime entries on MAL on the correct watch order for the anime franchise, including mangas,one shot's, Light Novels and these things...
  445. }); //Finishes the addEventListener click
  446.  
  447. chiakiButton.addEventListener("contextmenu", (e) => {
  448. window.open("http://www.relatedanime.com/manga/" + animeid, "_blank"); //Open relatedanime.com on a new tab to show all the related anime entries on MAL on the correct watch order for the anime franchise, including mangas,one shot's, Light Novels and these things...
  449. e.preventDefault(); //Don't show the right click default contextmenu
  450. }); //Detect the mouse right click
  451.  
  452. chiakiButton.setAttribute("title", "Click to Find Related Entries + Correct Watch Order. (Including mangas,one shot's, Light Novels etc...)\nRight Click to Find Related Entries + Correct Watch Order. (Including mangas,one shot's, Light Novels etc...)"); //Detects a mouse hover on the button and shows some text info
  453. chiakiButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAFY0lEQVQ4T13M2W9cVwEH4N85Z2bunX3xLB5fj8dbHCfNQpw00DjQEKApopsQbUkpVEK8VIAK6lsleIYnxCK1VAWV0ge6gtSqahtFiVCakjZJ6zb1GDupZ7wk9izXs9y5d+4959zDK/D9AR/B/1m5chn/+NNzmNw1g/HSaObSRwuPh6Khk3fN719759xFfWXdVIYx8sSj3/9BQ0Sj2KrV4AuB7KgBKQTIf2dSSvz+5z9DOB5DvjBcbDbqv7748cL3po00Pb67hNKkgTeu1fns9N7z88fnn7MYe3d4uNgGAOV62Ons/G94/q9/gWma0MPhYmVp+c/mTutuz+0hEqQIEooDB3dDGvtw6mvfgMY9T0Yil5U7uK5cTwlN+3jg+2eIY1kIhEJQnMMdOIhlhsizv/zFb/rtrSf2jTIkYgF0dyx0NnpY2urBHhrDj596CkahAGVZIIwBjg2l6ZC6vkn63c5JyljW5zwISvuVCxfI1fNnn43yVtYkDPU+gdnuoVXfRjxA0Hc5Ttw+p07/8Ee9SDwVhfQZ0TSQcBhwbBApZZ8AOnZ2iC+EWFn8zHnl5ZcSDdME08IAgFAwALPdQcs0QZXCIzM53HegZMuZgz1MHWuzVGYmEAoRdDqgACIEoOAe4a16sPrvpUR34EFwgawehLQtON0OhJRwHQf2YID36n30nE6ENRfe60jxuNJCbYTDUIyCisFgUQkO36zAXHgLq9VVtDttDGwLE2kdnLs4WEwhojwo5SMb1VHvOag0bUiX6lFNOxQIaQm4LpTvg3p2/wXZ7Uqx+BE2qk24UsG1bZRSEUwMJ3Bkt4E+93D6K/uRZICmfHhc4J/b1sDVYzdC3HqMAEzZfUgpNylX6mWfsQovlLBmC9xqNGHZNorZNFbWm/jyoRnc+615FMojKI8Mo9N1kIxqKORyQXe7fsfGa8+PbT39B6BeR5/zN2k6nV/tO85ZMnoIsUAQnU4bSgpUanW8v9LAleVNTBzai13zh3H6sXtw6tgeTI7mVVHAry/VjgS2N1IfvPAiLv/xGauxVHmTvvHM78L/OnMm6YM6u4xhGMkYjJFif6JckA/cPQcjn4BiFAgGsO+2Cdx73wlQPbK1fm1t2e4M0G30sOMMcO3ceZ2+8rc52rSd5I3V6nLlyqXlwsGjePDrd+Lhb97VkbHUUjYTVcfvvB1EKcheFywRA8sMtf1ApGbM7o0b5SmM3HYU5fExzGaSgeio8Qh1fdXlvvi77K8tasaYu+sLMzh6/Iv5UG586OqN+ltbjmjyZmPgrtfgrFaxeWOrZqVLH2xM783F98wicf9DOPzQg5jMpGQA9DV6sgz7p8eSjakUqbo+eZ34CszrBWKRyPD7607xxUX+7tsLtz6t3+yBXK9iqc13V9Ol7262rbCIpUASSQhNM2Uu3+dHDq9Rw+5jcNMa15vdm1yP/8oXbIOt1ZDJDEESOvdJF99ZbNO5eCaF0NQYcuNFnWh6HskhBOdOQDEG/Y5jT7NTp54n5fIGhWBQKmQKHvwwk0198rnLLsp4HsV0GonhMTDLDGl6jIniNLp6Hm6shFi+AC1XgA8KwgKC5vKX1VdP/pYVR65Stl0D3V5bvb7VvPTkq2cjL9U62VZxBiOFHLLGOJIHDgOJDMzwJFraNHwtBS0eAyEMUvogkUiDe15F5/JzSP8W7T38JPrf/gnOfelRDMWiuZrFJz8ze95QJqlyVIEJCUCg5Qg4JASb+1DSh7Jt+AA45xdurSyvOu028qNl0PzsfhT2HIAI6YAWTiGkJapt69NwMtGbyqfAWk0EiYue64FCgQxsCNcDlQLEdYXbrL9u5ApeIBgEAPwHGyeoH88NGw4AAAAASUVORK5CYII=)"; //The chiaki.site button favicon changed to the relatedanime.com favicon converted to DATA URI
  454. } //Finishes the if condition
  455.  
  456. titleElem.appendChild(chiakiButton); //Append the chiaki.site button close to the title element
  457. } //Finishes the if condition
  458. })(); //Finishes the whole function