Simple processing for iCal calendars

Dec 21, '04 01:18:00PM

Contributed by: denty

I work for a large company and use Snerdware's GroupCal software to see my company's calendar. I also keep a number of personal calendars. Although I was quite happy that my personal calendar details were published, I wasn't happy that others could see my company's activities. Also, I was concerned that people had to subscribe to three, possibly four, separate calendars to see my overall availability. I looked around for existing solutions to my problem, but I could not find anything in a casual search. I eventually settled on two basic functions that I wanted:

Although iCal provides the latter, it did not do so to the degree I wanted (events retained their titles). Also, because of the way Snerdware's solution works, I was unable to publish my company's calendar as it was already subscribed. So I wrote two very basic utilities using Perl regular expressions to process the calendar data. They are very basic and don't do much in themselves -- Mac OS X, UNIX and Apache do the rest.

In order to get around iCal's inability to re-publish subscribed calendar data, I told cron to copy the file on a regular basis to a shared directory. iCal also publishes a number of personal calendars to a WebDAV URL that OS X's Apache server makes available. A separate regular activity concatenates an anonymised version of my company's calendar with the personal calendars into one single calendar file, Personal.ics, that Apache then makes available as a regular URL on the web. The final piece is obviously totally formed around my requirements. But perhaps my scripts will be useful to others wanting to achieve something similar.

I ought to caveat that the scripts have been tested to the extent that, while I know they work for iCal and Mozilla project's Sunbird, they do not produce ideal files. I don't know if other programs will fail to read the files properly. For those of you who are interested or would like to try, I have put the scripts on my webspace -- click here to download. The intended audience is those with some basic UNIX scripting knowledge. I'm interested in knowing if these are useful, so if they're not 100% what you need, maybe I can help tailor them to other requirements.

Comments (2)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20041217203707435