Posted on 7/5/06 by Felix Geisendörfer
The authors of this post have marked it as deprecated. This means the information displayed is most likely outdated, inaccurate, boring or a combination of all three.
Policy: We never delete deprecated posts, but they are not listed in our categories or show up in the search anymore.
Before I forget: Thx to ros-soft for helping me with the https authentication function. Without him I might have lost my sanity after 2 hours of debugging and would have not been able to continue this blog here ; ).
Recently I've started using Google Calendar a lot. Not for everything, but for things like tracking the time I spent on projects of mine amongst other things. That's how this looks in my calendar (green are working hours, blue is private stuff):
Now after a while I realized that it would be interesting to list all the hours I spent on the projects I track in my "Working Hours" calendar (green). Unfortunatly Google does not yet offer such analytic tools for Google Calendar so I checked out the Google Calendar Data API to see how difficult it would be to fix this. Step by step I slowly began to play with it, and to create a CakePHP Model that I could use. Finally it became good enough for what I orginally needed, the list of projects, together with the hours that went into it:
So I decided to write a little tutorial about working with REST API's, like the Google Calendar one, and to publish the code I've written so far. It even has authentication build in, as well as a findAll function, But no way to add events to the calendar so far. Anyway for the people who are interested in stuff like this:
Here is a little snipped that shows how easy the usage is in the Controller:
var $name = 'Calendar';
var $uses = array('GoogleCalendar');
// Replace this with the feedUrl you want to work with
var $calURL = 'http://www.google.com/calendar/feeds/xxx/private-xxx/full';
$this->GoogleCalendar->authenticate('firstname.lastname@example.org', 'yourpassword', 'Company-App-Version');
$items = $this->GoogleCalendar->findAll($this->calURL, array(), 1024, '+30 minutes');
I hope that inspires people to do similar things with other API's in future ; ).
--Felix Geisendörfer aka the_undefined
You can skip to the end and add a comment.
This post is too old. We do not allow comments here anymore in order to fight spam. If you have real feedback or questions for the post, please contact us.