I wrote a bash function to get my daily Advent of Code input. It
assumes that you are in a directory ending in the pattern
where year is the year you’re doing the problems. Here’s the code
Steps to Use
- You’ll need to get your Advent of Code session id. You can extract
this by using the network inspector while in chrome, and grabbing the
value of the cookie header. It’s a rather long value.
my_cookieto this value.
- Put this function into your
- Source your updated
- Run it like
~/src/2020/3 $ get_advent_input > input.txt
- Remember to redirect your output to where you want to put your program input.
- You may want to modify the curl command to automatically output to a
file, but I didn’t since I want to see the output, or use