// ==UserScript== // @name Episode Discrepancy Checker with API // @namespace https://shikimori.one/ // @description Проверяет соответствие номера просмотренного эпизода номеру вышедшего эпизода с помощью API и выделяет ссылку красным цветом в случае расхождения. // @version 1.0 // @author Fujitawa // @match *://shikimori.tld/*/list/* // @match *://shikimori.one/*/list/* // @match *://shikimori.me/*/list/* // @grant GM_getValue // @grant GM_setValue // ==/UserScript== (function () { 'use strict'; async function checkEpisodeDiscrepancy() { var animeElements = document.querySelectorAll('.user_rate.selectable'); for (const animeElement of animeElements) { const animeId = animeElement.dataset.target_id; const apiEndpoint = `https://shikimori.one/api/animes/${animeId}`; try { const lastRequestTime = GM_getValue(`lastRequestTime_${animeId}`, 0); const currentTime = new Date().getTime(); if ((currentTime - lastRequestTime) > 1000) { const response = await fetch(apiEndpoint); const animeData = await response.json(); updateUI(animeElement, animeData); GM_setValue(`lastRequestTime_${animeId}`, currentTime); } } catch (error) { console.error(`Error fetching anime data for anime with ID ${animeId}:`, error); } } } function updateUI(animeElement, animeData) { if (animeData.status === 'ongoing') { const watchedEpisodes = parseInt(animeElement.querySelector('.current-value[data-field="episodes"] span').textContent, 10) || 0; const releasedEpisodes = animeData.episodes_aired || 0; if (watchedEpisodes !== releasedEpisodes) { animeElement.querySelector('.name a').style.color = 'red'; } else { animeElement.querySelector('.name a').style.color = ''; } } } function checkAndApply() { checkEpisodeDiscrepancy(); setTimeout(checkAndApply, 1000); } checkAndApply(); })();
/* Расположение блоков -----------------------*/ @media (min-width: 967px) { .profile-content .cc-2.block { display: grid; grid-template-columns: 1fr 23%; gap: 25px; } .profile-content .c-column.c-right { grid-area: 1 / 2 / 2 / 3; } .profile-content .c-column.c-left { grid-area: 1 / 1 / 2 / 2; } .profile-content .cc-2.block > *, .p-profiles-show .profile-content .c-right .cc-2a > * { width: 100% !important; margin: 0 !important; } .p-profiles-show .profile-content .c-right .cc-2a { display: grid; margin: 0 !important; gap: 15px; } }
[div=lightrope][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][span][/span][/div]
@media (min-width:1124px) { .l-page, .b-comments-notifier { margin-top: 5em; } .l-top_menu-v2 { position:sticky; top:0; } .lightrope { text-align: center; white-space: nowrap; position: fixed; top: 46px; left: 50%; transform: translatex(-50%); z-index: 1; margin: -15px 0 0 0; padding: 0; pointer-events: none; width: 100%; } .lightrope span { position: relative; animation-fill-mode: both; animation-iteration-count: infinite; list-style: none; margin: 0; padding: 0; display: block; width: 12px; height: 28px; border-radius: 50%; margin: 20px; display: inline-block; background: #00f7a5; box-shadow: 0px 4.6666666667px 24px 3px #00f7a5; animation-name: flash-1; animation-duration: 2s; } .lightrope span:nth-child(2n+1) { background: cyan; box-shadow: 0px 4.6666666667px 24px 3px rgba(0, 255, 255, 0.5); animation-name: flash-2; animation-duration: 0.4s; } .lightrope span:nth-child(4n+2) { background: #f70094; box-shadow: 0px 4.6666666667px 24px 3px #f70094; animation-name: flash-3; animation-duration: 1.1s; } .lightrope span:nth-child(odd) { animation-duration: 1.8s; } .lightrope span:nth-child(3n+1) { animation-duration: 1.4s; } .lightrope span:before { content: ""; position: absolute; background: #222; width: 10px; height: 9.3333333333px; border-radius: 3px; top: -4.6666666667px; left: 1px; } .lightrope span:after { content: ""; top: -14px; left: 9px; position: absolute; width: 52px; height: 18.6666666667px; border-bottom: solid #222 2px; border-radius: 50%; } .lightrope span:last-child:after { content: none; } @keyframes flash-1 { 0%, 100% { background: #00f7a5; box-shadow: 0px 4.6666666667px 24px 3px #00f7a5; } 50% { background: rgba(0, 247, 165, 0.4); box-shadow: 0px 4.6666666667px 24px 3px rgba(0, 247, 165, 0.2); } } @keyframes flash-2 { 0%, 100% { background: cyan; box-shadow: 0px 4.6666666667px 24px 3px cyan; } 50% { background: rgba(0, 255, 255, 0.4); box-shadow: 0px 4.6666666667px 24px 3px rgba(0, 255, 255, 0.2); } } @keyframes flash-3 { 0%, 100% { background: #f70094; box-shadow: 0px 4.6666666667px 24px 3px #f70094; } 50% { background: rgba(247, 0, 148, 0.4); box-shadow: 0px 4.6666666667px 24px 3px rgba(247, 0, 148, 0.2); } } }