It’s a Google Calendar mashup! Of sorts…

Okay, so I’ve updated the functionality of the Lincoln Council refuse collection calendar. You can find a bit of a write up on the Lincoln Web Development blog here. So go and read that then come back…

You’re back? Good. I hope that all made sense. The gist is that in our bin calendar database we store data for Postcode, Property (number and street name), Black and Brown Bin route, Green Bin route. The issue is that there is no direct correlation between when one property has their black and brown bins collected and when they have a green collection. A person with a monday black and brown collection may have a friday green collection, but another person with the same black and brown collection may have a tuesday green collection. Very hard to map.

So, in the previous version of the form we were simply pulling back the Google Calendar URLs and displaying them in separate iFrames, using a toggle on the form to switch between frames to show Black & Brown and Green. Simples. But confusing. In our Focus Group, one of the things that was brought up a number of times was how much better the calendar would be if both sets of calendars were on the same screen.

A bit of thinking later and I realised this could be done! When you publish a Google Calendar for embedding you can include any number of calendars from your account. Each calendar in the resulting URL is identified with an ID and colour reference, so in a URL of:

http://www.google.com/calendar/embed?title=Your%20Refuse%20and%20Recycling%20Collection%20Dates&showTitle=0&showCalendars=0&showTz=0&height=600&wkst=1&bgcolor=%23FFFFFF&src=bthsdtko816qqo075ftbppaktg%40group.calendar.google.com&color=%238D6F47&src=r2us9u7nolf3cd85ckq39j7mks%40group.calendar.google.com&color=%23705770&ctz=Europe%2FLondon

We can identify two individual calendars:

src=bthsdtko816qqo075ftbppaktg%40group.calendar.google.com&color=%238D6F47

and

src=r2us9u7nolf3cd85ckq39j7mks%40group.calendar.google.com&color=%23705770

So, we can split these values out! If we had a second URL of (this one is a green calendar):

http://www.google.com/calendar/embed?height=600&wkst=1&bgcolor=%23FFFFFF&src=hr8fnq99s7tq7bf3t348697ca4%40group.calendar.google.com&color=%230D7813&ctz=Europe%2FLondon

to get the id and colour of:

src=hr8fnq99s7tq7bf3t348697ca4%40group.calendar.google.com&color=%230D7813

we can combine this with our previous values to get the big ol’ URL of:

http://www.google.com/calendar/embed?title=Your%20Refuse%20and%20Recycling%20Collection%20Dates&showTitle=0&showCalendars=0&showTz=0&height=600&wkst=1&bgcolor=%23FFFFFF&src=bthsdtko816qqo075ftbppaktg%40group.calendar.google.com&color=%238D6F47&src=r2us9u7nolf3cd85ckq39j7mks%40group.calendar.google.com&color=%23705770&src=hr8fnq99s7tq7bf3t348697ca4%40group.calendar.google.com&color=%230D7813&ctz=Europe%2FLondon

adding back in the surrounding default values. Simples.

So now in our database, instead of holding URL’s we hold these individual identifiers. We only have one iFrame and the address to embed is constructed from:

http://www.google.com/calendar/embed?title=Your%20Refuse%20and%20Recycling%20Collection%20Dates&showTitle=0&showCalendars=0&showTz=0&height=600&wkst=1&bgcolor=%23FFFFFF&{refuseID}&{greenID}&ctz=Europe%2FLondon

So this is an example of taking on feedback, looking at the problem in a different way and coming up with a solution that improves the service for the customer. At no extra cost. I love it when a plan comes together 🙂

Advertisements

One thought on “It’s a Google Calendar mashup! Of sorts…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s