diff --git a/BinDays.Api.Collectors/Collectors/Councils/WakefieldCouncil.cs b/BinDays.Api.Collectors/Collectors/Councils/WakefieldCouncil.cs new file mode 100644 index 00000000..bac7a2be --- /dev/null +++ b/BinDays.Api.Collectors/Collectors/Councils/WakefieldCouncil.cs @@ -0,0 +1,233 @@ +namespace BinDays.Api.Collectors.Collectors.Councils; + +using BinDays.Api.Collectors.Collectors.Vendors; +using BinDays.Api.Collectors.Models; +using BinDays.Api.Collectors.Utilities; +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Text.RegularExpressions; +using System.Web; + +/// +/// Collector implementation for Wakefield Council. +/// +internal sealed partial class WakefieldCouncil : GovUkCollectorBase, ICollector +{ + /// + public string Name => "Wakefield Council"; + + /// + public Uri WebsiteUrl => new("https://www.wakefield.gov.uk/"); + + /// + public override string GovUkId => "wakefield"; + + /// + /// The list of bin types for this collector. + /// + private readonly IReadOnlyCollection _binTypes = [ + new() + { + Name = "General Waste", + Colour = BinColour.Green, + Keys = [ "Household waste", "General waste", "Refuse" ], + }, + new() + { + Name = "Recycling", + Colour = BinColour.Brown, + Keys = [ "Mixed recycling", "Recycling" ], + }, + new() + { + Name = "Garden Waste", + Colour = BinColour.Brown, + Keys = [ "Garden waste" ], + }, + ]; + + /// + /// Regex for the addresses from the address picker links. + /// + [GeneratedRegex(@"]*?href=""[^""]*?where-i-live\?uprn=(?[^&""]+)(?:&a=(?[^&""]+))?[^""]*""[^>]*>(?