The Force.com Toolkit for Google Data APIs has just been announced here at Tour de Force Santa Clara. The goal of the toolkit is to make Google App services, starting with Spreadsheets, Documents and Calendar, first class citizens of the Force.com environment.
I got my hands on the toolkit yesterday and wrote a little integration app. Essentially I created events on my Google Calendar from within my Force.com app, and listed those events too. Here’s what the code looked like to list events:

CalendarService service = new CalendarService();
service.setAuthSubToken(fetchToken());
GoogleData.Calendar cal = service.getCalendarByTitle('TechCalendar');
GoogleData feed = service.getFeed( cal.alternate );
for( xmldom.element e: feed.entries)
titles.add(new MyEvent(e.getValue('title'), e.getValue('content')));

As you can see, it takes about 5 lines of code to connect to a calendar and iterate through the events.
Creating an event is similarly straightforward:

CalendarService service = new CalendarService();
service.setAuthSubToken(fetchToken());
GoogleData.Calendar cal =
service.getCalendarByTitle('TechCalendar');
Event ee = new Event(
subject = 'Cool new Event',
description = 'Clouds in the sky',
ActivityDateTime = system.now(),
DurationInMinutes = 120
);
service.insertEvent(cal, ee);

The only part that requires brain cycles in getting any of this to work was the authentication structure, which is part of the Google Data API architecture. Essentially you (as the Google Calendar user, for example) have the authenticate your application with Google, which requires a few page redirects and token exchanges. At the end of the day you end up with a token that you use in all subsequent interactions (see the fetchToken() above).
There’s plenty of documentation (and test coverage) to get you going, and as the code is open source you can go and scrabble around for yourself too. Here are all the bits:

This opens the door to a lot of opportunities, so get coding!
Update 2008-June-24:
See Ryan’s post on this over on the Google Data API Blog.

Technorati Tags:
, ,

tagged , Bookmark the permalink. Trackbacks are closed, but you can post a comment.