// ==UserScript== // @name Find The Correct Watch Order And All Related Entries+Live-Actions+Doramas + Copy Entry Title // @namespace Search for Live-Actions\Doramas\All Related Entries + Correct Watch Order + Copy Entry Title // @version 2.0.0.8 // @description The script shows you the Correct Watch Order And All Related Entries. The script can also auto find if an anime has any Live-Action or Drama adaptations, and the script can Copy The Anime/Manga Title. // @author hacker09 // @include /^https:\/\/myanimelist\.net\/anime\/[\d]+(\/.*)?/ // @include /^https:\/\/myanimelist\.net\/manga\/[\d]+(\/.*)?/ // @grant none // @run-at document-end // @downloadURL none // ==/UserScript== //The lines below are the beginning of the function (function() { //Find and Select the entry title var titleElem = document.querySelector("#contentWrapper [itemprop='name']"); //The line below specify what should/can be copied to be searched on the websites a-z A-Z 0-9 and add a + symbol on the search url var title = titleElem.firstChild.textContent.replace(/[^a-zA-Z0-9]+/g, "+"); //The line below specify that the entry title should/can be copied with symbols to the clipboard var copytitlewithsymbols1click = titleElem.firstChild.textContent; //The line below specify what should/can be copied to the clipboard a-z A-Z 0-9 and add a space between the title words var copytitlewithoutsymbols2clicks = titleElem.firstChild.textContent.replace(/[^a-zA-Z0-9]+/g, " "); //The line below creates an "a" element so the buttons will appear var findButton = document.createElement("a"); var chiakiButton = document.createElement("a"); var copyButton = document.createElement("a"); //The line below detects the anime id to be added on chiaki website var animeid = location.pathname.match(/\d+/)[0]; //The lines below are the CSS for the copy button titleElem.setAttribute("style", "display: inline-block;"); //The lines below will detect the single mouse click and copy the entry title with symbols to the clipboard copyButton.addEventListener("click",()=>{navigator.clipboard.writeText(copytitlewithsymbols1click)}); //The lines below will detect the double mouse click and copy the entry title without symbols to the clipboard copyButton.addEventListener("dblclick",()=>{navigator.clipboard.writeText(copytitlewithoutsymbols2clicks)}); //The line below detects a mouse hover on the button and show the text Copy Entry Title copyButton.setAttribute("title", "1 Click To Copy Entry Title (+ Symbols) or 2 Clicks To Copy Entry Title (Without Symbols)"); //The lines below are the CSS for the copy button copyButton.setAttribute("style", "cursor: pointer;margin-left: 13px;height: 10px;width: 10px;background-size: cover;display: inline-block;transform: scale(1.8);vertical-align: top;margin-top: 7px;"); //The line below defines where the button should appear titleElem.parentElement.appendChild(copyButton); //The lines below are the copy button image converted to DATA URI copyButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkBhcOBQkNughZAAADCUlEQVRIx6XWS2hcVRzH8c90Jklji5qkmKipolFb2iBDQSw+KhXBRbEKLYqIiCi+4kLoJrgQfKAgiChN8UEXCr6KFVxUcFFQa6TpWDNGKUpcqKAMTU2lNdpEZ66LmTtz53FnbvQ3i5lz7r3f+/v//mcOJyWibPlrk11uNiCJin70lgnHIY909OoQ3GSvrc5KhGOFftdb53OnKCDT4G/Ey9bhmO8UpTrgAqtsMuRWcx7xt3pgpdzTcqY879cE/gJpV3nVqB1edwQ1D5X8unQJ/JWw4LIeskfKmD35msMKrtd6a2WiL6rTvBm/hfFXn5u1aKX+8kwmgrvauC3ObpPckq894wDZCjIvSyCIdinUdd52m34Z6dhPr8322hkx0aSwKed6yqUCn/jIHy09lgx7zGqDduP9msvWwM2uwQH3OhFb8HoPWk17ZAjcqEfRm2VcqzdnyVSdR5CNCjPsxVI8rlJ0LfxBu8tZxgHLSrXBcUIhMho0YUcnYHsd94ZSZHyeF1wZl2E0q3i9YpX7DVZsZFzsdjMdgNhgq+66mcC0Q0oWPO0dl+kSWONZQ0aJLutWwDVec23TbMF2OQRmzVYKHjcU6XwscGV5W2xQv75ow7KkpRrdtQb+4nF36GqYnTQpkZqBgX32N3Q/8E8yXOumUFRsNZ1NAFzOOvzPDm+0XXdz3CAlcNh7lpIDz/eS0bYm7vazT5OXHLTOL6JSuzuaHRaMuUVP25Knlpdh4jWXrOT/qdbrsLvNiwKLywOucJc7G3abeuAhLzodGQ/oxp9xwAs96ZK2Vd1gysdV3AXukXbGsbgMF/zUIaaCuervDd61DV84HOdw3gO26InFleRNV0cjRvCDJ/weB1TdQpOo5KTPPCcXTkSBqfLum+9IydbuznnUt87UnguB8+hxuYPJNikMG8D3viwPQxsh8KiT+oyZkUtwcuUi4/ootyJaUwic9oH7jNrvKwsdgIGMja7AER82XkxVM1lrwrZl/RW/8bDJxszTVE7/pxy0aNg5CaCBOfvschR15xP+BXLUxMa/tU5OAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA2LTIzVDE0OjA1OjAzKzAwOjAw5sMT7QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wNi0yM1QxNDowNTowMyswMDowMJeeq1EAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAAElFTkSuQmCC)"; //******************************************************************************************************************************************************************** if (window.location.pathname.split('/')[1] === 'anime') { //The lines below will detect the mouse click, and search for the anime title findButton.addEventListener("click",()=>{ async function CheckWithAMALClub() //Creates a function to Check With A MAL Club { //Starts the function const response1 = await fetch('https://myanimelist.net/clubs.php?cid=5450'); //Fetch const html1 = await response1.text(); //Gets the fetch response const newDocument1 = new DOMParser().parseFromString(html1, 'text/html'); //Parses the fetch response var content1 = newDocument1.querySelector("#content > table > tbody > tr > td:nth-child(2) > div"); const response2 = await fetch("https://api.allorigins.win/raw?url=https://mydramalist.com/search?q=" + title); //Fetch const html2 = await response2.text(); //Gets the fetch response const newDocument2 = new DOMParser().parseFromString(html2, 'text/html'); //Parses the fetch response var content2 = newDocument2.querySelector("div.col-lg-8.col-md-8"); var MyDramaListAsianWikiText,MyDramaListCheck,MalClubText,OpenMyDramaListOrNot; if (newDocument2.body.innerText.search(' found for: ') > -1) { MyDramaListAsianWikiText = ',AsianWiki and MyDramaList'; MyDramaListCheck = '👍 Found on MyDramaList.'; function OpenMyDramaListOrNot(){window.open("https://mydramalist.com/search?q=" + title, "_blank");} } else { MyDramaListAsianWikiText = ' and AsianWiki'; MyDramaListCheck = '✖ NOT Found on MyDramaList.'; function OpenMyDramaListOrNot(){} } if (newDocument1.body.innerText.search(copytitlewithsymbols1click) > -1) { MalClubText = '👍 Found on this MAL Club https://bit.ly/38KZxwH.'; } else { MalClubText = '✖ NOT found on this MAL Club https://bit.ly/38KZxwH.'; } if (confirm(MyDramaListCheck + '\n' + MalClubText + '\n\nDo you want to open IMDB'+MyDramaListAsianWikiText+' to confirm that information and get more detailed info?')) { window.open("https://www.imdb.com/find?q=" + title +"&s=tt&ref_=fn_al_tt_mr", "_blank"); window.open("http://asianwiki.com/index.php?title=Special%3ASearch&search=" + title, "_blank"); OpenMyDramaListOrNot(); } //Finishes the if condition } //Finishes the async function CheckWithAMALClub(); //Calls the function CheckWithAMALClub }); //The line below detects a mouse hover on the button and show the text Find Live-Actions findButton.setAttribute("title", "Find Live-Actions + Copy Entry Title"); //The lines below are the CSS for the findButton findButton.setAttribute("style", "cursor: pointer;margin-left: 15px;height: 10px;width: 10px;background-size: cover;display: inline-block;transform: scale(1.8);vertical-align: top;margin-top: 7px;"); //The line below defines where the button should appear titleElem.parentElement.appendChild(findButton); //The lines below are the copy button image converted to DATA URI findButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAQAAAAm93DmAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkBhcOEyPKmXRYAAACrElEQVRIx+3U32uVdRzA8de2s01d82wQ2GhotNYYSgqlzhSpIVhasF1IkP9ABbsLcdqFuIu6KOxyN120C5EIEemHlLSIkOEyWkRSHofb9NDaGQo7nZ7mtm8X6WmLneec7XTp+7n58nwe3t/P5/t5Pl8eUC4VBSMN2rRpUitr3FXXRavfZqMjhmSF/DPlU4clV5Nhwit6bXbHZd8Z85ekVjttk/CFE4ZWlttaJ0Wy+m1XveQAXnZBMOHQSnQJJy1I6cY6B7zrvDOeuBdd7y05GV2lCw+LpOzGbhfMCiKjduTjlXpErtlSmm6Tn2R1o9stwVde86wWVUtqeE8woKYU4RFBP3a5KedogZ42+9GMvcV1DYbcsd0anwiOx/yhbwpOFRfulPWlavtEvtEY8+VTpg1rWD5YmV+1qXPFXc+p9bHbMcIbUh7TVEzYhDG0mzMSW0tOWr2HiwlrESFlyGiscEGkqlCfE/lVFkn0WWsqVlil3l25YsJxtCIrK56kjW77vVjJV2XsuNfdpPoYYZsWv/qtmPC6y7bag6QB78fMQpd1LvqjmDByWsIb6s3JmBYK6LZ5Vdo5JbDe54JjqFlydS2m0TlBXyk66DAh6/VFeS+lQb9g0IZShRyS8ae3l52Drc4KfvB0zJwvQ5drgit6tHtIpQoJjTq8Y0Iw6BknfKDV4x4pVbnFgBnBpG+d8aGzvjcjuKXPBgmnBSlpP+speNb/ocZepwybEpmVkzboeP6e3mzMghHTZh0rVflPC9rt0alDi7pF7580acSjXnJzpcrlaZaS8SIO/j/KCkfNG/dCXtm76E5YFWv0mTORzzJr//1Q1aqEcy4JDnjeLz5TZ79RX5cjZN4l8w7qVGefTT4yXF7RUK3XjCC4qPnfAy6HhE67TDovXX5+D7jP32Dw0Zd65WyaAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIwLTA2LTIzVDE0OjE5OjI4KzAwOjAwfVN/JAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wNi0yM1QxNDoxOToyOCswMDowMAwOx5gAAAAASUVORK5CYII=)"; //******************************************************************************************************************************************************************** //The line below detects the mouse click, and search for related anime entries on MAL and shows the correct watch order for the whole anime chiakiButton.setAttribute("href", "https://chiaki.site/?/tools/watch_order/id/"+animeid); //The line below specifies that the link should be opened on a new tab chiakiButton.setAttribute("target", "_blank"); //The line below detects a mouse hover on the button and show the text Find Live-Actions chiakiButton.setAttribute("title", "Find Related Entries + Correct Watch Order"); //The lines below are the CSS for the chiakiButton chiakiButton.setAttribute("style", "margin-left: 15px;height: 10px;width: 10px;background-size: cover;display: inline-block;transform: scale(1.8);vertical-align: top;margin-top: 7px;"); //The line below defines where the button should appear titleElem.parentElement.appendChild(chiakiButton); //The lines below are the copy button image converted to DATA URI chiakiButton.style.backgroundImage = "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAAeFBMVEUAAADfceLecePYcefycdTMcfHZcefPce7tcdfQce3tcdffceLQce3tcdfeceLmcdziceDycdPLcfDYceflcd3KcfHycdPzcdPUce3tcdricePxtPDlkev0w/Pjg+ftf97ae+v10fboqvLvourvm+ftieHkm+/ah+6xZFdBAAAAGHRSTlMAFypl7u3s3t21tYlzc/Dv6MPCwsKJiWWHdugpAAAA1klEQVQY013Q2XLCMAwFUMehCQkJe4sW2wlZyv//YWVVzAD3yT5zNV6cxndNDVA3nXfPFOX5CzTVpSzMvpWMd8WHERDtVUs1U8mxlDPOLz3N1bvuvziOMIZAKREeetcAPCZmDpAip3kZCFtXg1Q4hpHCPXKcecCtk9HfKd6nKaWMLIgZH7kZkjRlIYYynrtMRIGXNfKCMt4YSuZZWMZb11UAlJIYDuuKOOCmd/5id8ZnTl6eWb3b5pY/ZLdXI7OfwqkeDczsk68Ho9NNzOL7div3a3uv2z/lrx6iZfibGQAAAABJRU5ErkJggg==)"; } //The line below is closing the whole function })();