// ==UserScript== // @name DLSite TL Unclaimed Works // @namespace https://xeno.science/ // @version 1.1 // @description See which works on DLSite Translators Unite haven't already been started by other translators // @author xenofem // @match https://*.dlsite.com/*/works/translatable // @match https://*.dlsite.com/*/works/translatable?* // @match https://*.dlsite.com/*/works/translatable/* // @run-at document-idle // @sandbox DOM // @license MIT // ==/UserScript== const TARGET_LANGUAGE_STRINGS = ["英語", "English"]; const OPEN_STRINGS = ["受付中", "Applications Open"]; function isIn(el, ar) { return ar.indexOf(el) !== -1; } function checkUnclaimed() { const works = document.getElementsByClassName("search_result_img_box_inner"); for (const work of works) { let unclaimed = false; const tlTable = work.getElementsByClassName("translation_table")[0]; for (const row of tlTable.getElementsByTagName("tr")) { if (isIn(row.children[0].textContent, TARGET_LANGUAGE_STRINGS) && isIn(row.children[1].textContent, OPEN_STRINGS) && row.children[2].textContent === "0" && row.children[3].textContent === "0") { unclaimed = true; break; } } if (!unclaimed) { work.style.opacity = "0.2"; } } } const checkButton = document.createElement("button"); checkButton.textContent = "Check unclaimed works"; checkButton.style.position = "fixed"; checkButton.style.top = "10px"; checkButton.style.right = "10px"; checkButton.addEventListener("click", checkUnclaimed); document.body.appendChild(checkButton); checkUnclaimed();