GoogleCal beta

Ugh. That’s all I can say. I spent a few hours the last few nights trying to get GoogleCal able to add events. I was finally able to do so with some help from Teddy Payne and a nice fellow on Google Groups. But wow. What an experience after working with the Yahoo services. How bad was it? This is how you add an event in Google’s Calendar API.

1) First you make a request passing in your username and password. This returns an authentication string.

2) Then you make a second request where you pass in your event data. The funny thing is here that Google says they may or may not return a redirect. In all my tests, it did return a redirect and you need to grab another authentication string called a gsessionid.

3) Guess what? Now you make a third HTTP request passing the same event data again.

That’s right - it takes three HTTP requests to add an event. Now I was able to cache the first one at least, but wow. What a royal pain in the rear. I mean - seriously - could they make it harder? Maybe I’m just not “Google Smart”.

Anyway - enough complaining. I’ve attached a zip of the new GoogleCal.cfc. I have not updated the core zip. I’d like folks to give it a quick test if they can (code snippet below). I don’t think it is very stable yet, but give it a try.

<cfset title = "Test Event 2"> <cfset description = "This is a test event."> <cfset authorName = "Raymond Camden"> <cfset authorEmail = "rcamden@gmail.com"> <cfset where = "Mars"> <cfset startTime = createDateTime(2006, 9, 30, 3, 0, 0)> <cfset endTime = createDateTime(2006, 9, 30, 3, 30, 0)>

<cfinvoke component=”#application.gcal#” method=”addEvent” returnVariable=”result”> <cfinvokeargument name=”username” value=”rcamden@gmail.com”> <cfinvokeargument name=”password” value=”imnottelling”> <cfinvokeargument name=”title” value=”#title#”> <cfinvokeargument name=”description” value=”#description#”> <cfinvokeargument name=”authorname” value=”#authorname#”> <cfinvokeargument name=”authormemail” value=”#authoremail#”> <cfinvokeargument name=”where” value=”#where#”> <cfinvokeargument name=”start” value=”#starttime#”> <cfinvokeargument name=”end” value=”#endtime#”> </cfinvoke> </code><p>Download attached file.</p>

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments