Check your bin day (LEEDS ONLY!)

@UnborN posted a similar solution to get this info from the Cardiff website.

I have tried to use that as a guide to get the same for Leeds, but I'm not getting anywhere.

https://www.leeds.gov.uk/residents/bins-and-recycling/check-your-bin-day

Based on my very limited knowledge it looks like it should also be possible, would anyone be able to help please :wink:

It might be possible but certainly not easy. Looks like it does a lookup to a SharePoint Online list.

Much easier to use a Google Calendar and just put your entries in it once a year. Most bin patterns are pretty regular so it isn't hard to set up a repeating pattern in a calendar. Then you can use the calendar in Node-RED.

So I thought of that but it would be too easy :crazy_face:
Actually the dates do often change around bank holidays etc, so "live" data would be best.

You could always reach out to the council's IT department and ask them if an API is available :grinning:

Or you could use something like Puppet and grab the resulting page output. Puppet or an equivalent headless browser is needed because the JavaScript on the page has to be executed (and there is a LOT of it).

There doesn't seem to be an API - you would have thought that would be UK wide thing.
If there isn't an easy way to get it from web page (challenge for someone there :wink: )

I have found a couple of CSV files one for address lookup and one for dates, updated daily.
The dates one is 165M tho :cry:

So now need to figure out how to extract the data from that. Not sure if its best to do in NR or command line with grep etc.

Nope, this is local councils we are talking about. Very little standardisation I'm afraid. Funnily enough though, I was just talking to a bunch of public sector IT architects this week about setting up a new initiative around shared IT standards. (I'm an Enterprise Architect by profession, not a developer :grinning: )

Definitely worth giving feedback to the council web site team though. Might be enough to trigger something.

Hmm, seems a bit big. Still, you only need to download it occasionally as I doubt it changes much other than maybe once a year.

Easily enough done in Node-RED though Python is rather better at handing CSV files than node.js. As is PowerShell. Just check that the process doesn't crash your Node-RED instance. If it is a problem, write a small Python or PowerShell script to extract just what you need and make it available as a new file. Or even load to a simple SQLite DB.

Did it a with small script using grep to extract dates for my street.
If anyone is interested I will write it up.

1 Like

It's no use to me since I'm not in Leeds, but nevertheless I'm interested to see how you've gone about it.

Nice dashboard for it too :slightly_smiling_face:

I would also be interested in seeing how you tackled it.
I'm in the UK too (north Hampshire)

The hard part is finding the data, Leeds does publish a 160M csv :cry: though.
I had a look for some kind of national data or API but it seems there isn't any.
I found comments about how Manchester should do like Leeds :wink:

So if you can find a similar csv for your area then you may be OK.

I'll post my method when I get a chance then.

3 Likes

There's an app available in the Google play store called 'Leeds Bins' which adds the bin dates to the calendar for you.

2 Likes

Yeah I have that, but its a manual process, every few weeks to run the app and add them in - far too much work :wink:

Also I don't have my calendar linked to node red. :confused:

Just posted the flow -

https://flows.nodered.org/flow/4fa6884882c7f37fad5ff354c3e6fa53

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.