AfvalwijzerCalendar 1.1.0

dotnet add package AfvalwijzerCalendar --version 1.1.0
NuGet\Install-Package AfvalwijzerCalendar -Version 1.1.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="AfvalwijzerCalendar" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AfvalwijzerCalendar --version 1.1.0
#r "nuget: AfvalwijzerCalendar, 1.1.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 AfvalwijzerCalendar as a Cake Addin
#addin nuget:?package=AfvalwijzerCalendar&version=1.1.0

// Install AfvalwijzerCalendar as a Cake Tool
#tool nuget:?package=AfvalwijzerCalendar&version=1.1.0

About

AfvalWijzer Calendar is a C# package for reading data from the dutch website https://www.mijnafvalwijzer.nl/. The packages parse the html code, does not use API.

How to use

Setup DI container

public void ConfigureServices(IServiceCollection services)
{       
    services.AddAfvalwijzerCalendarDependencies();
    services.AddScoped<IWasteCalendar, WasteCalendar>();
}

Call the calendar


public class GarbageDayTester
{
    private readonly IWasteCalendar _wasteCalendar;

    public GarbageDayTester(IWasteCalendar wasteCalendar)
    {
        _wasteCalendar = wasteCalendar;
    }

    public async Task<List<string>> GetGarbageDayForToday(string zipCode, string houseNumber, string houseNumberSuffix)
    {
        var garbageTypes = await _wasteCalendar.GetGarbageTypeForToday(zipCode, houseNumber, houseNumberSuffix);
        return garbageTypes;
    }

    public async Task<List<string>> GetGarbageDay(DateOnly day, string zipCode, string houseNumber, string houseNumberSuffix)
    {
        var garbageTypes = await _wasteCalendar.GetGarbageType(day, zipCode, houseNumber, houseNumberSuffix);
        return garbageTypes;
    }
}

Key Features

Get the list of the garbage types for a given day. It returns the dutch name of the garbage types as it is there in the website, without any transformation (e.g.: Papier en karton, Plastic, Metalen en Drankkartons).

Limitations

As it uses the https://www.mijnafvalwijzer.nl/ website as a data source, it can only return the data available at that site. That means that it can only access the data for the current year.

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
1.1.0 185 5/29/2023
1.0.0 157 5/12/2023