ICS Calendars for Stuttgart Gelber Sack Collections


Posted: 2013-10-27 13:22   |  More posts about code

Something I finished months ago but have only just gotten around to making public now is a service that provides ICS calendars for plastic rubbish collections in Stuttgart (the so called Gelber Sack Abholtermine).

The Problem

On the surface, the motivation is this: it's a pain to have to remember when your rubbish is going to be collected, an even greater pain to miss a collection and have sacks of rubbish accumulating on your balcony. Wouldn't it be great if your phone reminded you automatically, the night before?

"But," I hear you say, "you can already do this! Just download the Gelber Sack app, key in your information, and you're set!"

Unfortunately, it's not that simple. Without wanting to step on anyone's toes, the Gelber Sack App is, in a word, shit:

  • Here is a screenshot of it reminding me of a collection 4 days late:

  • The app also went through a period where it would pop up noticiations for all collections in the past few months:

  • This would cause your phone to flip out every time you turned it on, vibrating and ringing for about 5 seconds at a time. Great.

  • It occured to me that there's absolutely no need for a "Gelber Sack App". You've already got an app on your phone for this purpose - it's called Calendar. Why install another app, which may or may not work depending on how it's feeling, and uses the battery when running in the background?

It was this last point that led me to create this service.

The Solution

All good Calendar applications (Google Calendar and iCal included) have support for importing external calendars in the ICS format. So, you can add your facebook events to Google Calendar and have your calendar automatically update when you accept an invitation to an event on facebook. Why not do the same with Gelber Sack collections?

To use this service, simply visit this page (available in both German and English), enter your post code, select the street you live on, and you'll be presented with a URL for an ICS calendar which you can just copy and paste into the calendar software of your choice. Then, make sure this external calendar is also synced to your phone's calendar application, turn on notifications (I have mine set to 2 hours before, so I'm notified at 10PM the night before) and you'll never miss another rubbish collection!

For the nerds...

Source code for the application which scrapes the SITA Deutschland website and generates the ICS files is available on github here.

To avoid hammering SITA's servers, this program uses an extremely liberal (5-second) pause between each HTTP request.

comments powered by Disqus