NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name Bash.im clean AbyssBest // @namespace http://chamie.ru/ // @version 0.1 // @description Hides all the quotes in bash.im's Abyss Best section that've been posted a year ago. That really happens and a friend of mine was complaining. // @license MIT // @author Chamie (i@chamie.ru) // @match https://bash.im/abyssbest // @grant none // ==/UserScript== (async function () { const lastYrUrl = document.querySelector(".pager a:last-child").href; const lastYrPage = await fetch(lastYrUrl); const decoder = new TextDecoder("windows-1251"); const lastYrPageHtml = decoder.decode(await lastYrPage.arrayBuffer()); const lastYrQuotes = lastYrPageHtml.match(/<div class="text">.*<\/div>/g).map(x => x.match(/<div class="text">(.*)<\/div>/)[1]); const dups = [...document.querySelectorAll(".text")].filter(q => lastYrQuotes.some(lyq => lyq === q.innerHTML)); dups.forEach(q => q.style.display = "none"); document.querySelector(".pager").innerHTML += `<div><small>Скрыто дублей: ${dups.length}</small></div>`; })();