# Data
This tool will allow you to parse problem's input data into an array of strings automatically. Unfortunately, retrieve input data requires a private key. This makes it harder to start using this package, but it is worth it.
# Fetch Data
This method will allow you to forget about copying by hand every input puzzle by fetching it for you. To do it, your session cookie is required.
# How to retrieve your cookie
Assuming you're using Chrome, to retrieve your session follow this steps:
- Open adventofcode.com (opens new window).
- Log in.
- Open Chrome Devtools (F12).
- Go to Application tab.
- On the sidebar, under Storage section, expand Cookies and click on
https://adventofcode.com
. - Now you're seeing 3 cookies, one of them must be session. Copy it's value!
- Open your config file and save your cookie with key "session".
{
"session": "YOUR PRIVATE KEY"
}
# Parse data
While solving Advent of Code problems you will find large text files.
FFBFFFBLLL
BFBFBBFRLR
FFFBFFBLLL
...
In the end, you will only need an array of strings with text parsed, using newlines as a separator. That's what you will get on input, because that's all you need. The text file seen above, would look like this:
[
"FFBFFFBLLL",
"BFBFBBFRLR",
"FFFBFFBLLL",
...
]
# How AoC input data works?
Advent of Code allows people to compete inside webpage leaderboard. For that reason, data changes based on session cookie.
Session cookie changes for each logged in user. But also, it changes along time, each time you log in.