Bindicator Software
15 Feb 2025

And just like that, I've got the software sorted.
I created a basic C# console application that fetches and parses all the html content from a specific url, I gave it one that seems to line up with my address, and I used regex to create a pattern and track down the <td> with the appropriate title for tomorrows date in line with the formatting, then looked for a child element. If the child element exists then I check for a substring, "green" or "blue" since the child title is a descriptor of the bin collection cycles ("green bins are emptied every 8 days" etc.) and use this information to send an integer to the ESP32, corresponding to the GPIO pin and subsequent LED indicator to light up and show me which bin is due to be collected the next day.
Truth be told, I was expecting this to be a lot more difficult than it was. I'm very fuzzy on regex so I had a lot of help from AI, but web scraping was surprisingly easy, it's definitely something I'll utilise again in projects down the line.
My only concern is keeping everything in tact. Because I'm working on InSite, I have the API hosted on my desktop for development, and it's hosted at yikes.local, which was annoying enough to get working, so I just need to make sure that all stays true once I move it back over to being hosted on the YIKES machine. Once that's done though, the software side will be locked in. Now it's time to move off of the breadboard and onto a prototyping PCB. There isn't much to solder, but I'd like to consider how the LEDs will illuminate inside the 3D print (which I also need to do). For the most part now it's just making it all look nice and ensuring longevity, which is a relief really. All the heavy lifting is done!