Creating an RSS feed From an iCalendar Zimbra Stream

At TCG, we have moved to using Zimbra for company-wide collaboration and are rather pleased with its mail and calendar capabilities.  Within the system we created an event calendar to hold vacations or company events, and I thought that an RSS feed of the upcoming company events could be useful (especially since we have an RSS reader incorporated into our timesheet application).  However, hunting around I couldn’t find a script that took iCal streams or ICS files and created an RSS feed from them.

So, I combined Simon Wistow’s ics2graphvis Perl script, which grabs a specific date range from an ics file and makes a GraphViz graph out of it, with the Perl XML::RSS library.  The resulting script, ics2rss.pl, takes an ICS file (which can be created by running wget on Zimbra’s iCalendar URL), extracts any events coming in the next 14 days, and makes an RSS feed out of it.

To use it, you’ll need to use cpan to get ICal::DateTime and XML::RSS, update the title and links in the script to match what you need, and call “ics2rss.pl file.ics” (where file.ics is your wget’ed iCanedar stream).  In our environment, I wrote a cron job that runs every hour, grabs the iCalendar stream, and runs ics2rss.pl on it.