get

Function get 

Source
pub fn get(url: &str, cookie: &str) -> Result<String, Error>
Expand description

Gets input from the url or from cache if it has been retrieved before.

The url can be, e.g., https://adventofcode.com/2022/day/1/input. The cookie must be one retrieved by entering the site in your browser and inspecting network traffic. Instructions on how to retrieve the cookie can be found here or here. The cookie should look like this: session=abcd... without a trailing newline.

ยงExample

use aoc_cache::get;
const MY_COOKIE: &str = "session=xxxxxxxxxx"; // or, e.g., `include_str!("my.cookie")`
let input: Result<String, aoc_cache::Error> =
    get("https://adventofcode.com/2022/day/1/input", MY_COOKIE);