Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/al-ce/aocgofetch

CLI tool for fetching Advent of Code puzzle input
https://github.com/al-ce/aocgofetch

advent-of-code

Last synced: 2 days ago
JSON representation

CLI tool for fetching Advent of Code puzzle input

Awesome Lists containing this project

README

        

# aocgofetch

Fetches Advent of Code puzzle inputs and prints to standard out.

![screenshot](https://github.com/user-attachments/assets/eeee3242-2717-43e6-b456-3c52835d4882)

## Installation

Install with go >= 1.17

```bash
go install github.com/al-ce/aocgofetch@latest
```

Or clone this repository and build with `go build -o `.

This project uses [joho/gotodenv](https://github.com/joho/godotenv) as a dependency.

## Usage

### Authenticate

Authenticate yourself at `adventofcode.com` and get the value for the `session` cookie from your browser.

- Firefox: `Developer Tools > Storage > Cookies`
- Chrome: `Developer Tools > Application > Cookies`

Add that value to an `AOC_SESSION` key to a `.env` file at the root of your working directory, like your directory where you're writing your puzzle-solvers.

```bash
AOC_SESSION="yourCookieValue"
```

### Check your `.gitignore`

***WARNING:*** make sure you add the `.env` to your `.gitignore` if you're backing up your files to a remote repository!

***Reminder:*** please respect the author and do not include the puzzle text or the puzzle input in your repository.

### Run the program

Give the year (2015-present) and day (1-25) as arguments.
The puzzle input will print to `stdout`:

```bash
❯ aocgofetch 2015 4
ckczppom
```