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 Dorama adaptations, and the script can Copy The Anime/Manga Title.

当前为 2021-12-25 提交的版本,查看 最新版本

  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.29
  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 Dorama 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|manga)(id=)?(\.php\?id=)?)(\/)?([\d]+)?/
  10. // @exclude /^https:\/\/myanimelist\.net\/((anime|manga)(\/)(genre|producer))?/
  11. // @icon https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=http://myanimelist.net&size=64
  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 + "\nDone! 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:nth-child(1)')) { //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 no 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.  
  120. setTimeout(function() { //Starts the settimeout function (FIX for https://greasyfork.org/en/scripts/407591-anime-torrent-search-links )
  121. if (document.querySelector("a[href*='bakabt.me']") !== null) //If the link bakabt.me exists on the page
  122. { //Starts the if condition
  123. document.querySelectorAll("a[href*='Click+To']").forEach(link => link.href = link.href.split('%3Ca')[0]); //Fix the broken links
  124. } //Finishes the if condition
  125. }, 500); //Finishes the settimeout function
  126.  
  127. var titleElem = document.querySelector("[itemprop*='name']"); //Select the entry title element
  128. var titleText = titleElem.innerText.split('\n')[0]; //Select the entry romaji title text
  129. var findButton = document.createElement("a"); //Creates an "a" element to show a button later
  130. var copyButton = document.createElement("a"); //Creates an "a" element so the button will appear
  131. var chiakiButton = document.createElement("a"); //Creates an "a" element so the button will appear
  132. var animeid = location.pathname.match(/\d+/)[0]; //Get the anime id to add on the chiaki website url
  133. var ChiakiFranchiseTitle, ChiakiFranchiseTitleWithSymbols, response2, html2, MyDramaListDocument, response3, html3, MyDramaListText, MyDramaListCheck, MalClubText, ChiakiDocument, FranchiseHasTVType, Websites, LineBeak, Space, AnimeLinks; //Make these variables global
  134.  
  135. if (document.querySelector(".title-name") !== null) //On anime pages ".title-name" usually exists. If this element exists
  136. { //Starts the if condition
  137. titleElem = document.querySelector(".title-name"); //Select the entry title element
  138. titleText = document.querySelector(".title-name").textContent; //Select the entry title text
  139. } //Finishes the if condition
  140. if (document.querySelector(".title-english") !== null && document.querySelector(".title-name") === null) //On manga pages ".title-name" usually doesn't exists
  141. { //Starts the if condition
  142. var SaveEngTitle = document.querySelector(".title-english").innerText; //Save the english title to a variable
  143. document.querySelector("[itemprop*='name']").firstElementChild.remove(); //Remove Line Break <br>
  144. document.querySelector(".title-english").remove(); //Remove the Eng title
  145. setTimeout(function() { //Starts the setTimeout
  146. titleElem.insertAdjacentHTML('beforeend', '<br><span class="title-english">' + SaveEngTitle + '</span>'); //ReAdd the english title and line break to the page when the script finishes
  147. }, 0); //Finishes the setTimeout
  148. } //Finishes the if condition
  149.  
  150. copyButton.addEventListener("click", () => {
  151. navigator.clipboard.writeText(titleText); //Copy the entry title with symbols
  152. }); //Detect the single mouse click
  153. copyButton.addEventListener("dblclick", () => {
  154. navigator.clipboard.writeText(titleText.replace(/[^a-zA-Z0-9]+/g, " ")); //Copy the entry title without symbols
  155. }); //Detect the double mouse click
  156. 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
  157. 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
  158. titleElem.appendChild(copyButton); //Append the button close to the title element
  159. 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
  160. //********************************************************************************************************************************************************************
  161. 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
  162. { //Starts the if function
  163. var ChiakiTextData = []; //Creates a new blank array
  164. var ChiakiAnimeIDSArray = []; //Creates a new blank array
  165.  
  166. async function GetAnimeTitle() //Creates a function to Process and Get the Anime Title
  167. { //Starts the function
  168. if (ChiakiFranchiseTitle !== titleText) //If we haven't changed (yet) the franchise title we got from chiaki to the entry title
  169. { //Starts the if condition
  170. const response = await fetch('https://api.allorigins.win/raw?url=https://chiaki.site/?/tools/watch_order/id/' + animeid); //Fetch
  171. const html = await response.text(); //Gets the fetch response
  172. ChiakiDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response
  173. ChiakiFranchiseTitle = 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
  174. ChiakiFranchiseTitleWithSymbols = 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
  175. FranchiseHasTVType = false; //Define the variable as false
  176. if ([...ChiakiDocument.querySelectorAll('span.uk-text-muted.uk-text-small')].find(e => e.innerText.includes('TV')) !== null) { //Starts the if condition
  177. FranchiseHasTVType = true; //Define the variable as true
  178. } //Finishes the if condition
  179. } //Finishes the if condition
  180.  
  181. response2 = await fetch("https://api.allorigins.win/raw?url=https://mydramalist.com/search?q=" + ChiakiFranchiseTitle); //Fetch
  182. html2 = await response2.text(); //Gets the fetch response
  183. MyDramaListDocument = new DOMParser().parseFromString(html2, 'text/html'); //Parses the fetch response
  184.  
  185. if (MyDramaListDocument.body.innerText.search(' found for: ') > -1) //If MyDramaList returned any results
  186. { //Starts the if condition
  187. MyDramaListText = '\nMyDramaList'; //Display to the user that MyDramaList website will be opened if Ok is clicked
  188. MyDramaListCheck = '👍 Found on MyDramaList.'; //Display the confirmation that the anime has adaptations found on MyDramaList
  189. } //Finishes the if condition
  190. else { //Starts the else condition
  191. MyDramaListText = ''; //Display to the user that MyDramaList Won't be opened if Ok is clicked
  192. MyDramaListCheck = '✖ NOT Found on MyDramaList.'; //Display the confirmation that the anime doesn't have any adaptations found on MyDramaList
  193. } //Finishes the else condition
  194.  
  195. Websites = ''; //Creates a new blank variable
  196. LineBeak = ''; //Creates a new blank variable
  197. Space = ' '; //Creates a variable to add spaces to the text
  198. if (MyDramaListCheck.match('NOT') === null) //If MyDramaList returned any results
  199. { //Starts the if condition
  200. Websites = ' the following websites:\n'; //Display a message in plural
  201. LineBeak = '\n'; //Creates a variable to add Line Breaks to the text
  202. Space = ''; //Creates a new blank variable
  203. } //Finishes the if condition
  204. //*************************************************************************************************************************************************
  205. var TextElement = ChiakiDocument.querySelectorAll("span.uk-text-muted.uk-text-small"); //Creates a variable to loop through the elements after
  206. for (var i = 0; i < TextElement.length; i++) { //Starts the for condition
  207.  
  208. AnimeLinks = ChiakiDocument.querySelectorAll("span.uk-text-muted.uk-text-small > a:nth-child(1)")[i].href.match(/\d+/)[0]; //Store the anime links in a variable
  209. ChiakiAnimeIDSArray.push(AnimeLinks); //Add All Anime Links on chiaki to an Array
  210.  
  211. var TotalRawDuration = TextElement[i].textContent.split("×")[1].split("|")[0].trim(); //Creates a variable to hold the total unprocessed times
  212. var ALLChiakiTitles = ChiakiDocument.querySelectorAll("span.wo_title")[i].innerText; //Creates a variable to get all the anime titles on chiaki site
  213. var TotalEpisodes = TextElement[i].textContent.split("|")[2].match(/\d+|\?/g)[0]; //Creates a variable to hold the total episodes
  214. var EpisodeType = TextElement[i].textContent.split("|")[1].trim(); //Creates a variable to get the episode types
  215. var eps = ' eps'; //Create a variable called eps
  216. var Duration = ''; //Creates a blank variable
  217. var PerEp = ' per ep'; //Create a variable called PerEp
  218. if (TotalEpisodes === '1') { //If the entry has only 1 ep
  219. eps = ' ' + EpisodeType; //Change the variable called eps
  220. PerEp = ''; //Change the variable called PerEp
  221. } //Finishes the if condition
  222. if (EpisodeType !== 'TV') { //If the entry type isn't TV
  223. if (TotalEpisodes !== '1') { //If the entry doesn't have only 1 ep
  224. eps = ' ' + EpisodeType + 's'; //Change the variable called eps
  225. } //Finishes the if condition
  226. Duration = ' of ' + TotalRawDuration + PerEp; //Defines the Duration variable if the episode type isn't TV
  227. } //Finishes the if condition
  228. ChiakiTextData.push(ALLChiakiTitles + ',, ' + TotalEpisodes + eps + Duration + ',\n'); //Add Everything to an Array
  229. } //Finishes the for condition
  230. } //Finishes the async GetAnimeTitle function
  231. GetAnimeTitle(); //Call the GetAnimeTitle function
  232.  
  233. copyButton.addEventListener("contextmenu", (e) => {
  234. navigator.clipboard.writeText(ChiakiTextData.join('').trim()); //Copy the array to the clipboard
  235. e.preventDefault(); //Don't show the right click default contextmenu
  236. }); //Detect the mouse right click
  237. 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
  238.  
  239. findButton.addEventListener("click", () => { //Detect the mouse click and search for the anime title
  240. if (confirm('If you want to search using the Entry Title instead of the Franchise Title\nPress OK')) //Show the confimation alert box text
  241. { //Starts the if condition
  242. ChiakiFranchiseTitle = titleText; //Change the Franchise title we got from chiaki to the entry title (to seach on mydramalist)
  243. ChiakiFranchiseTitleWithSymbols = titleText; //Change the Franchise title we got from chiaki to the entry title (to search on the mal club)
  244. GetAnimeTitle(); //Call the GetAnimeTitle function to fetch the mydramalist website using the entry title
  245. } //Finishes the if condition
  246.  
  247. async function CheckWithAMALClub() //Creates a function to Check With A MAL Club
  248. { //Starts the function
  249. if (FranchiseHasTVType === true) //If the Franchise has at least 1 entry that the type is TV
  250. { //Starts the if condition
  251. const response = await fetch('https://myanimelist.net/clubs.php?cid=5450'); //Fetch
  252. const html = await response.text(); //Gets the fetch response
  253. const newDocument = new DOMParser().parseFromString(html, 'text/html'); //Parses the fetch response
  254.  
  255. newDocument.body.innerText.search(ChiakiFranchiseTitleWithSymbols) > -1 ? MalClubText = '👍 Found on the [[ Live Action Adaptations ]] MAL Club' : MalClubText = '✖ NOT found on the [[ Live Action Adaptations ]] MAL Club'; //If the title is found on the MALClub, display the confirmation whether or not the anime has adaptations found on the MALClub
  256.  
  257. var IMDBAsianWiki = 'IMDB and AsianWiki'; //Create a new variable txt
  258. if (MyDramaListCheck.match('👍') !== null || MalClubText.match('👍') !== null) //If mydramalist or the mal club returned any results
  259. { //Starts the if condition
  260. IMDBAsianWiki = 'IMDB\nAsianWiki'; //Change the variable txt
  261. } //Finishes the if condition
  262.  
  263. if (confirm('Franchise Title: ' + ChiakiFranchiseTitle + '\n\n' + MyDramaListCheck + '\n' + MalClubText + '\n\nDo you want to open' + Websites + Space + IMDBAsianWiki + MyDramaListText + LineBeak + Space + 'to confirm that information and get more detailed info?')) //Show the confimation alert box text
  264. { //Starts the if condition
  265. window.open("https://www.imdb.com/find?s=tt&q=" + ChiakiFranchiseTitle + "&ref_=nv_sr_sm", "_blank"); //Open IMDB on a new tab
  266. if (MyDramaListCheck.match('NOT') === null) {
  267. window.open("https://mydramalist.com/search?q=" + ChiakiFranchiseTitle, "_blank"); //Open MyDramaList on a new tab
  268. } //Open MyDramaList on a new tab only if any results were found on the website
  269. window.open("http://asianwiki.com/index.php?title=Special%3ASearch&search=" + ChiakiFranchiseTitle, "_blank"); //Open AsianWiki on a new tab
  270. } //Finishes the if condition
  271. } //Finishes the if condition
  272. else //If the anime doesn't have any entry type = TV
  273. { //Starts the else condition
  274. 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
  275. } //Finishes the else condition
  276. } //Finishes the async function
  277. CheckWithAMALClub(); //Calls the function CheckWithAMALClub
  278. }); //Finishes the advent listener
  279. findButton.setAttribute("title", "Search for Live-Actions/Doramas"); //Detects a mouse hover on the button and show the text Find Live-Actions
  280. 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
  281. titleElem.appendChild(findButton); //Append the button close to the title element
  282. 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
  283. //********************************************************************************************************************************************************************
  284. chiakiButton.addEventListener('mousedown', function(e) { //Detects when the user middle clicks on the chiakiButton
  285. if (e.button === 1) { //Starts the if condition If the middle mouse button was clicked
  286. (async () => { //Creates a function to check if the guide index has this anime watch order and Starts the function
  287. const response = await (await fetch('https://myanimelist.net/forum/?topicid=1890672')).text(); //Fetch
  288. const GuideIndexnewDocument = new DOMParser().parseFromString(response, 'text/html'); //Parses the fetch response
  289. 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
  290.  
  291. if (GuideIndexLinkElement !== undefined) //If the anime id was found on the guide index
  292. { //Starts the if condition
  293. if (GuideIndexLinkElement.previousElementSibling.innerText.match('あ') !== null) //If the anime name has the あ symbol in it on the guide index
  294. { //Starts the if condition
  295. alert('Recommended watch order:\nBroadcast order.'); //Shows an alert
  296. } //Finishes the if condition
  297. else //If the anime name doesn't have the あ symbol in it on the guide index
  298. { //Starts the if condition
  299. alert('Recommended watch order:\nAEGC Guide Order.'); //Shows a text
  300. } //Finishes the if condition
  301. 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
  302. } //Finishes the if condition
  303. else //If the anime id was NOT found on the guide index
  304. { //Starts the else condition
  305. var NotFoundMessage = document.createElement("a"); //Creates an a element
  306. NotFoundMessage.innerHTML = "<br>Not found on the AEGC Club!<br>Only chiaki.site will be opened.<br>"; //Defines the element text
  307. NotFoundMessage.setAttribute("style", "font-size: 80%;text-decoration: none;"); //Set the css for the button
  308. titleElem.appendChild(NotFoundMessage); //Append the NotFoundMessage close to the title element
  309. setTimeout(function() {
  310. window.open("https://chiaki.site/?/tools/watch_order/id/" + animeid, "_blank");
  311. }, 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
  312. } //Finishes the else condition
  313.  
  314. 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
  315. var GuideIndexIDS = []; //Creates a new blank array
  316. var match; //Creates a new blank variable
  317. for (match in GuideIndexIDSmatches) //For every anime id existent on the GuideIndexIDSmatches text content
  318. { //Starts the for condition
  319. GuideIndexIDS.push(GuideIndexIDSmatches[match].replace(/(?:\|)/gi, '')); //Remove the first | symbol in front of the anime id numbers
  320. } //Finishes the for condition
  321. var FinalArray = ChiakiAnimeIDSArray.filter(d => !GuideIndexIDS.includes(d)); //Get the ids that chiaki.site has and the Guide is missing
  322. var GuideMissingIds = document.createElement("div"); //Creates a div element
  323. GuideMissingIds.setAttribute("style", "font-size: 80%;display: none;"); //Set the css for the button
  324. FinalArray.forEach(function(AnimeID) { //For every anime id that the guide index is missing
  325. 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
  326. }); //Finishes the foreach condition
  327.  
  328. if (FinalArray.length !== 0) //If there's at least 1 missing id on the guide index
  329. { //Starts the if condition
  330. var LinksButton = document.createElement("button"); //Creates a button element
  331. LinksButton.innerHTML = 'Show AEGC Club Missing Links'; //Defines the element text
  332. LinksButton.setAttribute("style", "margin-left: 10px;"); //Set the css for the button
  333. LinksButton.onclick = function() { //Detects the mouse click on the Show Links Button
  334. if (GuideMissingIds.style.display === "none") { //If the Show missing links button is hidden
  335. GuideMissingIds.style.display = ''; //Show the missing links button
  336. LinksButton.innerHTML = 'Hide AEGC Club Missing Links'; //Defines the element text
  337. } else { //If the Show missing links button is being shown
  338. GuideMissingIds.style.display = "none"; //Hide the missing links button
  339. LinksButton.innerHTML = 'Show AEGC Club Missing Links'; //Defines the element text
  340. } //Finishes the else condition
  341. }; //FInishes the onclick advent listener
  342. titleElem.appendChild(LinksButton); //Display the button to show the ids that chiaki.site has and the Guide is missing
  343. titleElem.appendChild(GuideMissingIds); //Display the ids that chiaki.site has and the Guide is missing
  344. } //Finishes the if condition
  345.  
  346. if (FinalArray.length === ChiakiAnimeIDSArray.length) //If the guide index is missing the exact same amount of total links that chiaki has for the franchise
  347. { //Starts the if condition
  348. LinksButton.remove(); //Remove the button that shows the missing links
  349. } //Finishes the if condition
  350.  
  351. 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
  352. { //Starts the if condition
  353. LinksButton.remove(); //Remove the button that shows the missing links
  354. var TwoFranchises = document.createElement("a"); //Creates an a element
  355. 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
  356. TwoFranchises.setAttribute("style", "font-size: 80%;text-decoration: none;"); //Set the css for the button
  357. titleElem.appendChild(TwoFranchises); //Append the NotFoundMessage close to the title element
  358.  
  359. 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
  360. } //Finishes the if condition
  361.  
  362. var MatchDupsRegex = new RegExp('(?:\\|' + animeid + '\\|)', 'gi'); //Creates a new variable to add the anime id to an regex variable
  363. if (GuideIndexnewDocument.querySelector("div.clearfix.word-break").firstChild.innerText.match(MatchDupsRegex).length > 1) //If 2 identical anime ids were found on the guide index
  364. { //Starts the if condition
  365. var OtherFranchiseMessage = document.createElement("a"); //Creates an a element
  366. 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
  367. OtherFranchiseMessage.setAttribute("style", "font-size: 80%;text-decoration: none;"); //Set the css for the button
  368. titleElem.appendChild(OtherFranchiseMessage); //Append the OtherFranchiseMessage close to the title element
  369. } //Finishes the if condition
  370.  
  371. })(); //Finishes the async function
  372.  
  373. e.preventDefault(); //Prevent the default middle button action from executing
  374. } //Finishes the if condition
  375. }); //Finishes the mousedown advent listener
  376.  
  377. var MangaOnlyFranchise = false; //Creates a new global variable
  378. } //Finishes the if condition
  379.  
  380. 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
  381. 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
  382. 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
  383.  
  384.  
  385. if (window.location.pathname.split('/')[1] === 'manga') //If the user is in an manga entry
  386. { //Starts the if function
  387. if (document.querySelector("table.anime_detail_related_anime") === null) { //Starts the if condition
  388. AnimeLinks = document.getElementsByTagName('a'); //Creates a variable to hold all links elements on the page
  389. } //Finishes the if condition
  390. else //If the opened page has any Alternative versions:, Spin-offs:, Adaptations: or Other: links elements on the page
  391. { //Starts the else condition
  392. 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
  393. } //Finishes the else condition
  394.  
  395. MangaOnlyFranchise = true; //If the actual loaded page is manga let's consider the franchise as if it didn't have any anime adaptations
  396. for (var i = 0; i < AnimeLinks.length; i++) { //Loop through all links elements on the page
  397. if (AnimeLinks[i].href.match(/^https:\/\/myanimelist\.net\/anime\/[\d]+(\/.*)?/) !== null) //If the link is anime
  398. { //Starts the if condition
  399. animeid = AnimeLinks[i].href.match(/\d+/)[0]; //Try to get 1 anime id of the franchise
  400. MangaOnlyFranchise = false; //If the script found 1 anime id for the franchise change the variable to true
  401. break; //After the first anime id of the franchise was found stop the for loop condition
  402. } //Finishes the if condition
  403. } //Finishes the for loop condition
  404.  
  405. } //Finishes the if condition
  406.  
  407. if (MangaOnlyFranchise === false) //If the manga entry HAS anime entries on MAL
  408. { //Starts the if function
  409. chiakiButton.addEventListener("click", (e) => { //Detect the mouse click
  410. 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
  411. }); //Finishes the addEventListener click
  412.  
  413. chiakiButton.addEventListener("contextmenu", (e) => {
  414. 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...
  415. e.preventDefault(); //Don't show the right click default contextmenu
  416. }); //Detect the mouse right click
  417.  
  418. 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
  419.  
  420. } //Finishes the if condition
  421.  
  422. if (MangaOnlyFranchise === true) //If the manga entry has NO anime entries on MAL
  423. { //Starts the if function
  424. chiakiButton.addEventListener("click", (e) => { //Detect the mouse click
  425. 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...
  426. }); //Finishes the addEventListener click
  427.  
  428. chiakiButton.addEventListener("contextmenu", (e) => {
  429. 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...
  430. e.preventDefault(); //Don't show the right click default contextmenu
  431. }); //Detect the mouse right click
  432.  
  433. 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
  434. 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
  435. } //Finishes the if condition
  436.  
  437. titleElem.appendChild(chiakiButton); //Append the chiaki.site button close to the title element
  438. } //Finishes the if condition
  439. })(); //Finishes the whole function