.ics Files and Google Calendar

Dear Lazyweb,

I’d like to open .ics calendar files, like those provided by Facebook’s “Export” button on an event, with Google Calendar. However, Google has not yet seen fit to provide a suitable URL for use with registerContentHandler(), as they have for Gmail with mailto: and registerProtocolHandler().

Please write a Jetpack or Greasemonkey script which does the following:

  • Adds a “Register” button to the Google Calendar interface, which registers the “add event” web form URL as the handler, with a “icsfile=%s” parameter.
  • Runs code on that form’s URL which detects the parameter, XMLHttpRequests the .ics file, parses it, fills in the fields on the form, and presses “Submit”.

For bonus points, reuse the JavaScript .ics file parser to do the same trick for Yahoo! and other web calendars.



3 thoughts on “.ics Files and Google Calendar

  1. Google calendar does support .ics files, both ways: it can subscribe to them and show them on your Google calendar, and it can also generate iCalendar data from a Google calendar so that you can subscribe to your Google calendar in e.g. Sunbird.

    My employer has an iCalendar feed (which is generated using Perl code I wrote, based on the same database that also drives the calendar on our website and the news pages), and I’ve had the events from it showing up on my Google calendar for, oh, a year or so now.

    To add an .ics calendar to your Google calendar, find the Add button under the list of calendars (on the left side), and choose Add by URL. Easy.

    Am I missing something?

  2. Synchronicity, same question here, with a slightly different wording. Still no answer unfortunately.


    Jonadab what you’re missing is that this isn’t a feed of events from Facebook. Facebook gives you one ICS file per event from an Export button on their website, if there was a feed of all the Facebook Events you’re invited to that would be ok to add to GCalendar, unfortunately you’d have to do this every time you’re invited to an event.

  3. From bug 391286 , it sounds like Firefox can only registerContentHandler() for RSS mime types, even though the WHATWG Web Applications spec http://www.whatwg.org/specs/web-apps/current-work/#custom-handlers has no such limitation.

    Related, though Google search is now parsing hRecipe and hReview microformats, Google Calendar’s Add > Add by URL doesn’t parse hCalendar microformat in pages. You have to use a bookmarklet, Greasemonkey script, or extension that notices hCalendar, save it as .ics, then add that in Google Calendar. Makes it a hassle to add a QMO test day to one’s calendar.

Leave a Reply

Your email address will not be published. Required fields are marked *