AoC Puzzle Description and Input Data
Configures HTTP requests to fetch Advent of Code puzzle descriptions and input data from the official website.
What this file does
Configures HTTP requests to fetch Advent of Code puzzle descriptions and input data from the official website.
When to use it
- Setting up automated puzzle data retrieval for AoC
- Writing a script or agent that needs to download daily puzzle inputs
- Creating a local AoC project structure with sample and user inputs
Assumes this stack
trigger: always_on
AoC Puzzle Description and Input Data
When asked to retrieve any information from the Advent of Code (AoC) website, use the following configuration for API calls to https://adventofcode.com.
Obtain AOC_SESSION_COOKIE
- This environment variable may already be set. If not, find it in .env.
HTTP Headers
- Cookie:
session=<AOC_SESSION_COOKIE> - User-Agent:
github.com/derailed-dash/Advent-of-Code by derailed.dash@gmail.com(Recommended by AoC)
Retrieving Puzzle Description
- URL:
https://adventofcode.com/{year}/day/{day}(e.g.,https://adventofcode.com/2018/day/2) - Note: The description usually has two parts. Part 2 is only available after Part 1 is solved.
Retrieving Sample Puzzle Input
- Source: The "sample input" is usually found within the puzzle description HTML, often in a
<pre><code>block. - Part 1 vs Part 2: Sample inputs may differ between parts. Part 2 description is locked until Part 1 is complete.
- Storage: Save as
/src/AoC_{year}/d{nn}/input/sample_input_part_n.txt- Ensure
d{nn}is zero-padded (e.g.,d04).
- Ensure
Retrieving (User-Specific) Puzzle Input Data
- URL:
https://adventofcode.com/{year}/day/{day}/input - Storage: Save as
/src/AoC_{year}/d{nn}/input/input.txt- Ensure
d{nn}is zero-padded.
- Ensure
Operational Rules
- No Unsolicited Actions: Do NOT perform additional steps (like solving the puzzle) unless asked.
- Cleanup: Do NOT persist the downloaded
desc.htmlfile. If you download it for processing, you MUST delete it immediately after the task is complete.
What's inside
5 operational sections: session cookie, HTTP headers, puzzle description retrieval, sample input retrieval, user input retrieval, plus cleanup rules.
Change this for your project
- Replace
github.com/derailed-dash/Advent-of-Codewith your own repository URL - Replace
derailed.dash@gmail.comwith your own email - Replace
/src/AoC_{year}/d{nn}/input/with your own project path
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Related Documents
Data Retrieval
Downloads UK electricity generation and pricing data from Electric Insights and Energy Charts APIs using the moepy library, then visualises fuel-mix time-series.
Lesson 4: Information Retrieval
Guides building a Flask app that fetches Bitcoin exchange rates from multiple APIs, stores them in SQLite, and displays best rates and historical trends.
Papers
Lists 100+ papers on deep learning for image retrieval and hashing, each with links and brief metadata.
开放领域问答中的密集段落检索
Explains dense passage retrieval for open-domain QA and provides a code template using Simple Transformers to train a DPR model.