colinodell / aoc-downloader
Downloads Advent of Code puzzles and inputs
Fund package maintenance!
colinodell
www.colinodell.com/sponsor
www.paypal.me/colinpodell/10.00
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Type:project
Requires
- php: ^7.4 || ^8.0
- guzzlehttp/guzzle: ^7.3
- league/html-to-markdown: ^5.0
- symfony/console: ^5.3
- symfony/css-selector: ^5.3
- symfony/dom-crawler: ^5.3
Requires (Dev)
- humbug/box: ^3.13
- unleashedtech/php-coding-standard: ^3.1
README
Simple PHP-based utility to download all Advent of Code puzzles and inputs locally.
Requirements
This project requires PHP 7.4 or higher.
Installation
There are three ways to download and use this utility:
Composer Dependency
Using PHP for your AoC puzzles? You can include this as a dev dependency in your repository:
composer require --dev colinodell/aoc-downloader
Standalone PHAR
Don't want to mix dependencies or prefer a single executable file?
A pre-compiled PHAR is also available via the Releases tab.
Simply download the .phar
file, make it executable, and run it.
From Source
git clone https://github.com/colinodell/aoc-downloader.git
cd aoc-downloader
composer update -o --no-dev
Usage
You'll need to log into adventofcode.com and grab your session
cookie using your browser's dev tools:
You can then pass that as an argument to this utility:
Usage:
./bin/aoc-downloader [options] [--] <session_id>
Arguments:
session_id Session ID (from the adventofcode.com `session` cookie
Options:
-o, --output=OUTPUT The directory to save the downloaded files [default: "./puzzles"]
-y, --year=YEAR The year to download puzzles for (default is all years)
-h, --help Display help for the given command. When no command is given display help for the ./bin/download.php command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
It will save both the puzzle test and input data locally:
puzzles/2020
├── day01
│ ├── input.txt
│ └── README.md
├── day02
│ ├── input.txt
│ └── README.md
├── day03
│ ├── input.txt
│ └── README.md
├── day04
│ ├── input.txt
│ └── README.md
├── day05
│ ├── input.txt
│ └── README.md
├── day06
│ ├── input.txt
│ └── README.md
├── day07
│ ├── input.txt
│ └── README.md
├── day08
│ ├── input.txt
│ └── README.md
├── day09
│ ├── input.txt
│ └── README.md
├── day10
│ ├── input.txt
│ └── README.md
...