A little gift for my Stockholm Pride fellas

The upcoming week Stockholm Pride will take over my home city with lots of colorful people and events. The official site, www.stockholmpride.org, has a great program feature where you can put together your own program for the week. However, it lacked the possibility to export the events in a format accepted by calendar applications such as Apple iCal, Google Calendar and Outlook.

So, deap comes to the rescue; I spent last eventing and a good part of this morning putting together a little service that parses your personalized program and exports the events as an .ics-file.

The original idea was to load the program page url with the help of the .net WebClient class, but for some reason the program event elements wasn’t included in the response stream I got. I’m guessing that they probably are being loaded through ajax but didn’t investigate it further. Instead I made some instructions on how to download the file as html and then upload that to my application where the parsing will take place.

To parse the HTML I made a quick google and decided to make use of the HTML Agility Pack, and some nifty XPath (see this tutorial) and Regular Expressions. I’ve never used this library before and it’s been a couple of years since I wrote some XPath, but it was really easy to get started. When it came to generating the .ics-file in a proper format, which caused some trouble, I got great help from this .ics validator.

I also decided to give a go at adding the internet invading Facebook Like button AND a share ;-).

You can check the result out at http://pride.deap.nu, but be aware, it’s all in swedish ;-).