jonathondgebhardt / advent-of-code-cpp

Advent of Code
0 stars 0 forks source link

Download input for an arbitrary day #1

Closed jonathondgebhardt closed 11 months ago

jonathondgebhardt commented 11 months ago

input:

cargo download <day>

output:

# output:
# Downloading input with aoc-cli...
# Loaded session cookie from "/home/felix/.adventofcode.session".
# Downloading input for day 1, 2021...
# Saving puzzle input to "/tmp/tmp.MBdcAdL9Iw/input"...
# Done!
# ---
# 🎄 Successfully wrote input to "src/inputs/01.txt"!
jonathondgebhardt commented 11 months ago

Important note: inputs and sample inputs should not be maintained by git. reasoning

jonathondgebhardt commented 11 months ago

https://github.com/jonathondgebhardt/AOC-2022-Rust#download-puzzle-inputs-via-aoc-cli

jonathondgebhardt commented 11 months ago

I would really like to download both sample and real input, not sure how getting the sample would work. I'd have to scrape the page or something looking for the code section but I feel like AoC would not appreciate that.

jonathondgebhardt commented 11 months ago

A quick search says libcurl is the way to go: https://stackoverflow.com/a/1129200

jonathondgebhardt commented 11 months ago

I've also implemented downloading sample input :)