Last active
May 19, 2025 03:24
-
-
Save mesmere/9250182f915e74b7c8c3b810569b5c8c to your computer and use it in GitHub Desktop.
Utility to print all dates between a start date and now
This file contains hidden or 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
| import process from 'node:process' | |
| import 'temporal-polyfill/global' // Remove once node ships TC39 | |
| if (process.argv.length !== 5) { | |
| console.error("Usage: node print-dates.mjs startyear startmonth startday"); | |
| process.exit(1); | |
| } | |
| const startDate = new Temporal.PlainDate(process.argv[2], process.argv[3], process.argv[4]); | |
| const endDate = Temporal.Now.plainDateISO('America/New_York'); | |
| let date = startDate; | |
| while (Temporal.PlainDate.compare(date, endDate) <= 0) { | |
| console.log(date.toString()); | |
| date = date.add({ days: 1 }); | |
| } |
This file contains hidden or 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
| node print-dates.mjs 2025 5 15 | date -f - +%y%m%d | ( | |
| while read date; do | |
| filename=wsj$date.puz | |
| echo "Downloading $filename..." | |
| curl --remote-name --silent --show-error "https://herbach.dnsalias.com/wsj/$filename" | |
| done | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment