“Hey Alexa, what bin do I need to take out?” – building an Alexa skill with data from @MbroCouncil

I don’t know about you, but I can never remember which bin I need to take out.

Is it the blue one? Have the green ones resumed? Anyone else stuck theirs out yet? Who knows….

Now, I could print off a calendar, but what’s a printer? Even then the printer I have is an old mono-chrome laser printer made in the mid 1990s… So, not particularly good when it comes to the coloured boxes. And yes, surprisingly, it still works, just. 

Now Middlesbrough Council don’t provide any sort of API to pull data from, which would have made this 10x easier. Unlike York.

A while back I tweeted about this

So did (at the end of last year)…

The only thing they have as a data source is a PDF download, or an ICAL formatted calendar. They do also have a form which shows the next 5 collections, but I couldn’t work out the calls to make – or how to create the initial session. Plan B it was.

So using their ICAL, I was able to scrape the data based on which calendar area you passed through.

I did end up making an improvement on my MK-I website too, which works OKish, it’s just a tad janky on mobile sometimes. But hey, I’m predominately a backend coder.

Next bin collection on my website

 

So the next logical step had to be creating an Alexa Skill…

Don’t worry I’ve cut the “Hey Alexa” out of the video.

Quite nifty yeah?

The next step is making it flexible, at the minute the GET request is hardcoded to my area’s bin timetable, but I’ve already got ideas on how I can extend this and not have to worry about storing emails…

I’ll get round to tidying up my code for this and making it look less embarrassing, with a follow up on how to knock together a simple (and maybe useful) Amazon Alexa Skill.

Until then…

Related Post

Leave a Reply

Your email address will not be published.