Trafford Council
Name of Council Trafford Council
Example Address/Postcode M33 2AL
Additional Information https://www.trafford.gov.uk/BinCollections/
Verification
- [x] I searched for similar issues at https://github.com/robbrad/UKBinCollectionData/issues?q=is:issue and found no duplicates
- [x] I have provided a tested working address/postcode/UPRN with bin collections available
- [x] I understand that this project is run by volunteer contributors and completion depends on numerous factors - even with a request, we cannot guarantee if/when your council will get a script
+1 for Trafford Council.
+1
@pr0qye / @matt-volp / @c-its-wilson how should we handle this https://www.trafford.gov.uk/residents/environment/recycling-rubbish-and-waste/docs/collection-calendars/WED-CAL-A.pdf ? all all bin types connected on the same say
When I check the bins I just see a day reported
Yes it seems really annoying the site only gives the day, then links to the PDF (which we also get a printed copy of) for the actual rotations of which are collected each week. My thoughts a) Contact the council and see if they will provide a proper API (You never know!) b) Try and parse the PDF (Not impossibly, but pretty hard) c) Maintain a manual db that someone updates for all the calendar types each year (Manual isn't good, but probably the easiest).
Thanks @qgazq < given it only gives a day we can work with this but what I need to know is do all bins get collected that day ?
No unfortunately not.
If you look at my calendar: https://www.trafford.gov.uk/residents/environment/recycling-rubbish-and-waste/docs/collection-calendars/THU-CAL-B.pdf The table in the top left is the schedule. Green (food and garden waste) is collected every week. Grey (general waste) is collected every other week, 27th Feb, 13th March, 27th March. Blue (paper) is collected every four weeks, 20th Feb, 20th March, 17th April. Black (cans, glass, plastic) is collected every four weeks, 6th March, 3rd April, 1st May.
There is a pattern, grey, black, grey, blue - repeat. So "manual" entry could just be a indication of where in the cycle the start day is, and calculate the rest from that. There would also have to be manual for the red dots, which are where the day shifts over Christmas.
An added complication, if you look at my URL, I'm Thursday Calendar B, there is an A as well. So even scraping "Thursday" from the site isn't enough, we'd have to scrape the URL to know which Thursday Calendar.
I think the way im going to approach this given the complexity of parsing a PDF and the unreliability of a single day is offer an integration that can parse a Google Calendar api
This "should" allow you to populate a Google calendar with events and still use this integration
Let me know your thoughts on this - before I start coding it
I'm happy to go with the flow. I'm not sure how many different calendars there are for Trafford collections. For example my collection day is Friday B.
Is there somewhere we can share google calendars in case others can use them?
Probably - however it makes sense from a scaling perspective if people create their own. We can always change it in the future should they release an API
Also I think this could work for other councils if they have the same issue
Yes I don't think trying to parse a pdf is sensible, and they may format it different each year. My guess is there are around 10 calendars, Mon - Fri, A & B, but I haven't tried to enumerate them to check.
So here is a calendar I just made with Thursday B, is this the sort if thing you were thinking? https://calendar.google.com/calendar/u/0?cid=Y19iY2E2Yzk3NTU0NTIxMzYyMmIzOTU4YmRkYWI1NjdlMWU3Mzk4NzA5YzYzZTM3N2I2ZmU5YTkxNDBiZDFjYWY4QGdyb3VwLmNhbGVuZGFyLmdvb2dsZS5jb20 Then have it import from there, and people can just select which calendar you like (if someone has already made one, or if not make one yourself).
My thoughts a) Contact the council and see if they will provide a proper API (You never know!)
For what it's worth, I think it might still be worth contacting the council - I'm not sure who is the right person or how to get in touch just now, but there must be a team dealing with data etc. - the activity on this github issue shows that there's at least some interest, and it's definitely the best solution..
I wonder if there are other councils that have already done this, that we could maybe point Trafford towards (do other councils publish contact names of their teams - can Trafford's team speak to Council X's team maybe?) to help them on their journey..?
After speaking to a colleague at work, I also tried getting ChatGPT to parse the PDF, just to see if that would work as an approach.
It seems to be unreliable as to whether it will download the PDF or complain that it can't access it (retrying fixes that), but I don't think it's quite ready for prime-time in this use case. It needed quite a bit of tweaking to get a query that produced a reasonable output, and at that point it would certainly have been quicker to just manually type in the dates into a calendar 😄 but it's an interesting approach at least, so am including it here..!
My prompt is below, in case anyone else wants to try. I had 'Reasoning' turned on. (In a previous test, ChatGPT can produce an .ics file but I didn't specify that here as it's easier to view the output as normal HTML)
Given the bin collection calendar at https://www.trafford.gov.uk/residents/environment/recycling-rubbish-and-waste/docs/collection-calendars/WED-CAL-A.pdf, please convert the PDF to an image before you process it, and then generate a calendar for the year showing me what bins to put out and on what dates each week. The schedule in Trafford (this is the "A" schedule) works with a green bin for garden waste each week and then an alternating cycle of others described by the shape on the left of the dates. Pay attention to the shapes to the left of the dates that define which recycling bin is out each week - the bins that these shapes correspond to are described on the right-hand side. Also pay attention to the coloured dots to the right of the dates that signify a collection day on a different day.
I've apparently used my free credits for today on ChatGPT and it didn't quite get there.. but it was fun to try at least!
My thoughts a) Contact the council and see if they will provide a proper API (You never know!)
For what it's worth, I think it might still be worth contacting the council - I'm not sure who is the right person or how to get in touch just now, but there must be a team dealing with data etc. - the activity on this github issue shows that there's at least some interest, and it's definitely the best solution..
I wonder if there are other councils that have already done this, that we could maybe point Trafford towards (do other councils publish contact names of their teams - can Trafford's team speak to Council X's team maybe?) to help them on their journey..?
I've put a request in on their site Request ID: CAS-20330-M0G7
I put a link to the MCC (Manchester City Council) website. Since they are all part of Greater Manchester and work together on some topics.
Not sure it will get anywhere, but worth a try.
@qgazq : Im working on adding Google Calendar public calander url support to this repo