this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

initial import

joshua stein 5da708b7

+107
+13
LICENSE
··· 1 + Copyright (c) 2025 joshua stein <jcs@jcs.org> 2 + 3 + Permission to use, copy, modify, and distribute this software for any 4 + purpose with or without fee is hereby granted, provided that the above 5 + copyright notice and this permission notice appear in all copies. 6 + 7 + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+5
README.md
··· 1 + # crossword.script 2 + 3 + A dumb AppleScript to automate fetching the current day's 4 + ["Stan Newman's Daily Crossword"](https://www.arkadium.com/games/stan-newmans-daily-crossword/) 5 + as a PDF, suitable for e-mailing to my wife's Kindle Scribe.
+89
crossword.script
··· 1 + -- 2 + -- Copyright (c) 2025 joshua stein <jcs@jcs.org> 3 + -- 4 + -- Permission to use, copy, modify, and distribute this software for any 5 + -- purpose with or without fee is hereby granted, provided that the above 6 + -- copyright notice and this permission notice appear in all copies. 7 + -- 8 + -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 + -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 + -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 + -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 + -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 + -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 + -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 + -- 16 + 17 + -- AppleScript to open Safari, open a private window, navigate to the 18 + -- "Stan Newman's Daily Crossword" page, bypass all the junk, then bring 19 + -- up the printable version of today's crossword as a PDF, and then save 20 + -- it to the desktop as "crossword.pdf" 21 + 22 + tell application "System Events" 23 + tell application "Safari" to activate 24 + delay 1 25 + keystroke "n" using {command down, shift down} 26 + delay 1 27 + set u to "https://www.arkadium.com/games/stan-newmans-daily-crossword/" 28 + keystroke u 29 + keystroke return 30 + delay 5 31 + 32 + -- bypass cookie screen 33 + tell application "Safari" 34 + tell document 1 35 + do JavaScript "Array.from(document.getElementsByTagName('button')).filter((b) => b.innerHTML == 'CONFIRM').at(0).click();" 36 + end tell 37 + end tell 38 + delay 1 39 + 40 + -- click 'play now' 41 + tell application "Safari" 42 + tell document 1 43 + -- do JavaScript "Array.from(document.getElementsByTagName('button')).filter((b) => b.innerHTML == 'Play Now').at(0).click();" 44 + do JavaScript "document.getElementsByClassName('ark-ad-button-text ctaButtonText')[0].parentElement.click();" 45 + end tell 46 + end tell 47 + 48 + -- sit through some ads 49 + delay 60 50 + 51 + -- click default 'PLAY' button on today 52 + tell application "Safari" 53 + tell document 1 54 + do JavaScript "Array.from(document.getElementsByTagName('button')).filter((b) => b.innerHTML == 'PLAY').at(-1).click();" 55 + end tell 56 + end tell 57 + delay 2 58 + 59 + -- bring up the webpage's print dialog (not safari's) 60 + keystroke "p" using {control down} 61 + delay 2 62 + 63 + -- click 'Print' 64 + tell application "Safari" 65 + tell document 1 66 + do JavaScript "Array.from(document.getElementsByTagName('button')).filter((b) => b.innerHTML == 'Print')[0].click();" 67 + end tell 68 + end tell 69 + delay 4 70 + 71 + -- once PDF is up, save it in safari 72 + keystroke "s" using {command down} 73 + delay 2 74 + 75 + -- and navigate to ~/Desktop and save it as "crossword.pdf" 76 + keystroke "~" 77 + delay 2 78 + keystroke "/Desktop/" 79 + delay 2 80 + keystroke return 81 + keystroke "crossword.pdf" 82 + delay 1 83 + keystroke return 84 + delay 1 85 + 86 + -- quit safari 87 + delay 1 88 + keystroke "q" using {command down} 89 + end tell