Skip to content

A small, basic, utility package to help pull down the input (maybe more, like submit, in the future) for Advent of Code.

License

Notifications You must be signed in to change notification settings

FizzBuzz791/NAoCHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI/CD

A small, basic, utility package to help pull down the input (maybe more, like submit, in the future).

Installation

CLI

dotnet add package NAoCHelper

NuGet

Search for NAoCHelper in your package manager of choice.

Usage

  1. Create an appsettings.json in your project root that looks like the following;

    {
        "Secrets": {
            "Cookie": "Configured in User Secrets"
        }
    }
  2. Run dotnet user-secrets init to add secret management to your project. Take note of the User Secrets ID.

  3. Run dotnet user-secrets set Secrets:Cookie session=... to set your cookie (see Notes section for how to find it).

  4. Use code like the following to get your puzzle input;

    using NAoCHelper;
    ...
    var user = new User(Helpers.GetCookie("YourUserSecretsID"));
    var puzzle = new Puzzle(user, 2019, 1);
    
    Console.WriteLine(puzzle.GetInputAsync().Result);

Notes

This requires the cookie for your session. Use dev-tools to find this in the request headers, it should look like cookie: session=536..., save the value only (session=536...).

About

A small, basic, utility package to help pull down the input (maybe more, like submit, in the future) for Advent of Code.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages