Calendar
Between work, church, and two kids, I have a fair bit of scheduling information to keep track of. Work uses exchange (yuck), but I had been happily using webcalendar. After a bit of research, I've managed to get access to work's exchange calendar in ical format, and access it as a remote calendar layer in webcalendar.
Contents |
Perl Script
This was the key piece, how to get access to the exchange calendar items via imap, and convert to ical format. I happily found that most of the work was already done, when I found this script from a thread on macosxhints.com.
I run the script from cron twice an hour to generate a .ics file, which is then subscribed to via webcalendar.
Enhancements
I am considering running the perl script as a cgi, so that the newest information is always available, however I don't want to risk exposing my email account information.
WebCalendar
I did have to hack up webcalendar a bit, as it seems exchange puts some events in odd timezones. To correct this, I had to make the following patch to xcal.php to get it to parse exchange's TZIDs
# created with diff -Naur /usr/local/src/WebCalendar-1.1.6/includes/xcal.php xcal.php
# apply with cat ~/webcalendar-xcal.php.patch | patch from withing in webcal/includes dir
--- /usr/local/src/WebCalendar-1.1.6/includes/xcal.php 2007-09-12 22:07:02.000000000 -0400
+++ xcal.php 2008-03-27 11:59:23.000000000 -0400
@@ -2293,6 +2293,8 @@
break;
case 'US-Eastern':
case 'US/Eastern':
+ case '"(GMT-05.00) Eastern Time (US & Canada)"':
+ case '"Eastern Time (US & Canada)"':
$this_TIMEZONE = 'America/New_York';
break;
case 'US-Central':
@@ -2301,6 +2303,8 @@
break;
case 'US-Pacific':
case 'US/Pacific':
+ case '"(GMT-08.00) Pacific Time (US & Canada)/Tijuana"':
+ case '"GMT -0800 (Standard) / GMT -0700 (Daylight)"':
$this_TIMEZONE = 'America/Los_Angeles';
break;
case '':
This allowed webcalendar to import all events in the correct timezone. I also setup a cron to run tools/reload_remotes.php every half hour to make sure I always have an updated copy of the events in webcalendar. I then added this remote calendar as a layer to my calendar, and now I can see both work and personal events in the same calendar.
Other cool tricks
upcoming.php can be embedded into another page via iframes to show upcoming events. Can even specify category, so I can see upcoming bills only.

