AoCAPI 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package AoCAPI --version 2.0.0                
NuGet\Install-Package AoCAPI -Version 2.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AoCAPI" Version="2.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AoCAPI --version 2.0.0                
#r "nuget: AoCAPI, 2.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AoCAPI as a Cake Addin
#addin nuget:?package=AoCAPI&version=2.0.0

// Install AoCAPI as a Cake Tool
#tool nuget:?package=AoCAPI&version=2.0.0                

A simple NuGet package to handle personal AoC data directly from your .NET project

Documentation

<br><br>

Add to your project

dotnet add package AoCAPI
using AoC.API;

<br>

Initialization

var client = new Session("session cookie", int year, int day);
var client = new Session("session cookie", string input, Regex pattern);

INFO: The Regex overload needs to have the group containing the year named "year" and the group containing the day named "day".

How to obtain session cookie

How to name Regex groups

<br>

Features

Get input file

string inputText = client.GetInputText(); // input file (raw text)
string inputLines = client.GetInputLines(); // input file (lines)

<br>

Get achieved stars

Dictionary<int, int> allStars = client.GetAllStars(); // all user's achieved stars
int thisYearStars = client.GetThisYearStars(); // user's achieved stars from initialized year

<br>

Submit answer

bool succeeded = client.SubmitAnswer(int level, object answer); // submits answer to initialized year and day, returns true if answer is correct

<br><br>

credits to:<br> Max - markdown info icons<br> Monday Morning Haskell - documentation on how to obtaining session cookie<br> Developer.Mozilla - documentation on how to name Regex groups

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.3.0 68 7/31/2024
2.2.11 50 7/29/2024
2.2.10 110 4/26/2024
2.2.9 107 4/21/2024
2.2.8 141 4/7/2024
2.2.7 493 12/9/2023
2.2.6 404 12/4/2023
2.2.5 396 12/4/2023
2.1.5 399 12/3/2023
2.1.4 409 12/3/2023
2.1.3 418 12/2/2023
2.0.3 435 11/10/2023
2.0.2 438 9/15/2023
2.0.1 457 9/6/2023
2.0.0 419 9/6/2023
1.0.5 460 7/30/2023
1.0.4 463 7/29/2023
1.0.3 473 7/29/2023
1.0.2 454 7/29/2023
1.0.1 470 7/29/2023
1.0.0 483 7/29/2023