Created
July 5, 2021 04:07
-
-
Save vegeta897/f44fddba492acde5f19c8d0384022c72 to your computer and use it in GitHub Desktop.
WSJ crossword bookmarklet to copy list of clues for Discord
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){function getBoxes(e){return""===e.innerText.trim()?e.children.length:" `"+[].slice.call(e.children).map(e=>e.innerText||"_").join(" ")+"` "}function listClues(e){return`\n**__${e.toUpperCase()}__**\n`+[].slice.call(document.getElementsByClassName("puzzle-frame")[0].contentDocument.getElementById(e+"holder").children[0].children[1].children).map(e=>"**"+e.children[0].innerText.replace("\n","** ").split("_").join("\\_")+" ("+getBoxes(e.children[1])+")").join("\n")}navigator.clipboard.writeText(`<${window.location.href.replace("www.","")}>${listClues("across")}\n${listClues("down")}`);})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage
Notes
If you found this useful, you can give it a ⭐
Leave a comment here if you have any questions or anything else to say 💬
You can also add me on Discord
vegeta897#7777