Status

Location
Arlington, VA
Subscribe to GeoRSS Subscribe to KML


Google Calendar API

Published in Google, Google Calendar, Programming, Technology, Web


There is now a GoogleCalendar API. They also cleaned up their XML. This is very exciting, as to date I was having to parse a lot of the data by hand in the summary field. Of course, “API” is loosely used here, as really they’re just publishing a specification of their feed format.

For example the date is now its own tag:

<gd:when startTime='2006-04-17T15:00:00.000Z'
endTime='2006-04-17T17:00:00.000Z'></gd:when>

And the location is either as simple as a name:

<gd:where valueString='The best pad'></gd:where>

The format specifies possible advanced location encoding via GeoPoints, postal address, primary and alternate locations.

<gd:postalAddress>
   22646 Woodward Ave.
  Ferndale, MI  48220
</gd:postalAddress>

up to:

<gd:where rel="http://schemas.google.com/g/2005#event"
      valueString="Woodward Ave Brewers">
  <gd:entryLink href="http://local.example.com/10018/JoesPub">
    <id>http://local.example.com/10018/WoodwardAveBrewers</id>
    <category scheme="http://schemas.google.com/g/2005#kind"
        term="http://schemas.google.com/g/2005#contact"/>
    <content>Good beer</content>

    <link href="http://www.woodwardavenuebrewers.com"/>
    <gd:contactSection>
      <gd:postalAddress> 22646 Woodward Ave., Ferndale,
              MI  48220</gd:postalAddress>
      <gd:geoPt lat="40.75" lon="-74.0"/>
      <gd:phoneNumber>(212) 555-1212</gd:phoneNumber>

      <gd:email address="info@woodwardavenuebrewers.com"/>
    </gd:contactSection>
  </gd:entryLink>
</gd:where>

This makes it much nicer for parsing. The API even allows for adding new events to a calendar.

Update: you have to make sure and grab the full version of the Calendar feed and not the basic
version. The Basic version contains the same old wonkiness. However, the full version is the new yummy XML-ified version. You select this by changing the last tag on the URI.

Basic:

http://www.google.com/calendar/feeds/username@gmail.com/private-magicCookie/basic

vs.

Full:

http://www.google.com/calendar/feeds/username@gmail.com/private-magicCookie/full

Similar Posts

Leave a Response