C# class for getting input

This page summarizes the projects mentioned and recommended in the original post on /r/adventofcode

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • advent-of-code-jq

    Solving Advent of Code with jq

  • using System.Diagnostics; namespace AocUtilities; public static class AocInput { public static readonly HttpClient Client = new(); public static readonly string Session = ""; public static readonly string SavePath = $"{AppContext.BaseDirectory}\\input.txt"; public static HttpContent GetHttpInputContent(HttpClient client, string session, int year, int day) { Debug.Assert(!string.IsNullOrWhiteSpace(session)); Debug.Assert(session.All(c => char.ToLower(c) is >= 'a' and <= 'z' or >= '0' and <= '9')); var request = new HttpRequestMessage( HttpMethod.Get, $"https://adventofcode.com/{year}/day/{day}/input"); request.Headers.Add( "Cookie", $"session={session}"); var response = client.Send(request); var content = response.Content; return content; } public static TextReader GetInput(int year, int day) { TextReader reader; if (File.Exists(SavePath)) { reader = File.OpenText(SavePath); return reader; } var httpInputContent = GetHttpInputContent(Client, Session, year, day); var inputStr = httpInputContent.ReadAsStringAsync().Result; Debug.Assert(!inputStr.Contains("Please log in to get your puzzle input")); reader = new StringReader(inputStr); File.WriteAllText(SavePath, inputStr); return reader; } }

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Ask HN: How do I get better at programming as a hobbyist?

    1 project | news.ycombinator.com | 23 Apr 2024
  • What Happens After Agile Dies?

    1 project | dev.to | 11 Apr 2024
  • When was the last time you used this? - Part 2: Algorithms

    1 project | dev.to | 28 Mar 2024
  • 2023, a year in images

    1 project | dev.to | 8 Mar 2024
  • Having a Game I'm into Makes Every Day Enjoyable

    1 project | news.ycombinator.com | 24 Dec 2023