Skip to content

Instantly share code, notes, and snippets.

@mesmere
Last active May 19, 2025 03:24
Show Gist options
  • Select an option

  • Save mesmere/9250182f915e74b7c8c3b810569b5c8c to your computer and use it in GitHub Desktop.

Select an option

Save mesmere/9250182f915e74b7c8c3b810569b5c8c to your computer and use it in GitHub Desktop.
Utility to print all dates between a start date and now
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 });
}
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