smalltalkDaily

Smalltalk Daily 10/01/10: Using Google Calendar Feeds

October 1, 2010 8:41:59.825

Today's Smalltalk Daily looks at using the client authentication to Google we built to retrieve an Atom feed of calendar events. The code I'm demonstrating is in the public store repository under the name GCal-Example - the usage in the screencast is below. To skip to the video, click here.


"get the request token - cl is the calendar service"
gAuth := AuthRequest 
	requestTokenFor: 'cl' 
	user: username
	password: password
	clientName: 'Cincom-VisualWorks-771'.

"get the response as XML"
request := EventRangeRequest
		from: (Timestamp 
			readFrom: '09/01/10 0:00:00' readStream)
		to: (Timestamp 
			readFrom: '10/01/10 0:00:00' readStream).
response := ServiceRequest
					makeRequestWith: gAuth
					requestPrepObject: request.
xml := response contents.

"save the results as a file for addition to any RSS/Atom aware tool"
file := 'calFeed.xml' asFilename writeStream.
file nextPutAll: xml.
file close.

To watch now, use the viewer below:

If you have trouble viewing that directly, you can click here to download the video directly. If you need the video in a Windows Media format, then download that here.

You can also watch it on YouTube:

Technorati Tags: , , ,

Enclosures:
[http://www.cincomsmalltalk.com/casts/stDaily/2010/smalltalk_daily-10-01-10-iPhone.m4v ( Size: 5847203 )]

 Share Tweet This
-->