8000 GitHub - acroca/aocfetch: Advent of Code tool
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

acroca/aocfetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aocfetch

Use this tool to get your input files for Advent of Code.

The tool downloads and caches the files, so it's safe to use frequently as it won't download the file every time.

Requirements

The tool needs your Advent of Code session to work. You can find your session in your browser, look into the cookies for https://adventofcode.com/ and copy the value for the session cookie.

Put the value in an environment variable called AOC_SESSION for the tool to work.

Examples

The following example will print out the input for the day 1 of 2021

$ export AOC_SESSION=12345
$ aocfetch --year 2021 --day 1
123
126
130
137
140
...

You can pipe it to your implementation and read the contents from the stdin. The following example calls a ruby implementation:

$ export AOC_SESSION=12345
$ aocfetch --year 2021 --day 1 | ruby src/2011/01/main.rb
Part 1: 1799
Part 2: 1899

About

Advent of Code tool

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0