Importing foreign (non-iCal) calendars into Google Calendar

August 19, 2008 at 03:24 PM | categories: python, free state project | View Comments

Google Calendar is highly useful. I use it to keep track of all my appointments and due dates and I get helpful reminders when dates approach via email and SMS. Not only that, but it allows me to collaborate with other people's calendars as well, and they don't even have to use Google Calendar because Google supports the industry standard iCalendar format. Things are great.

Unfortunately, iCalendar format is pretty new, and not everyone is using it.

Because Google Calendar is so useful, it is annoying when you find a calendar that is not in iCal format. Two of note that I want to follow are

Both of these calendars are running Simple Machines Forum, version 1.x which does not support iCalendar format (presumably they will in 2.0).

So I wrote an exporter: Download SMF iCal exporter

The exporter scrapes the calendar page on an SMF enabled site and dumps out an iCal compatible file.

Usage: -u -o cal.ics

Download a SMF 1.x forum calendar and dump in iCal format

  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -u URL, --url=URL     URL of forum (up to and including /index.php)
  -n Name, --name=Name  Name of the Forum / Calendar (name goes in .ics file)
  -i EXPR, --ignore-re=EXPR
                        Ignore any event containing this regular expression
                        (specify as many -i as you want)
  -o File, --output=File
                        iCal filename to write
  -v, --verbose         Be verbose about process
                        Number of months to go backward
  --months-forward=NUM  Number of months to go forward

I have this tool running in a cron job to keep up to date with the two above mentioned calendars. You can import these URLs directly into your Google Calendar:

Update 09/16/08: I uploaded version 2 of this application. It has a better README and it now supports user specific date ranges.

blog comments powered by Disqus