diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-01 22:08:12 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-01 22:08:12 -0500 |
commit | 1290e72f736443fe55fe91e2680ca427e60e1bce (patch) | |
tree | 399de0121126a852cb3a225b93d2f0358d4b36cf | |
parent | f9573cf0b5de23e258791fbdc424fd3abbc4fdc5 (diff) | |
download | advent-of-code-1290e72f736443fe55fe91e2680ca427e60e1bce.tar.gz advent-of-code-1290e72f736443fe55fe91e2680ca427e60e1bce.zip |
script to download data files
-rw-r--r-- | .gitignore | 1 | ||||
-rwxr-xr-x | bin/get-input | 7 |
2 files changed, 8 insertions, 0 deletions
@@ -1 +1,2 @@ /target +/.cookie diff --git a/bin/get-input b/bin/get-input new file mode 100755 index 0000000..da76600 --- /dev/null +++ b/bin/get-input @@ -0,0 +1,7 @@ +#!/bin/sh + +day=${1:-$(date +%-d)} +year=${2:-$(date +%Y)} + +mkdir -p data/"$year" +curl -b "$(cat .cookie)" -s https://adventofcode.com/"$year"/day/"$day"/input >data/"$year"/"$day".txt |