2 messages in com.googlegroups.google-calendar-help-dataapiGetting timezone and "where" from pub...
FromSent OnAttachments
Daniel Karp21 Mar 2008 07:51 
Austin (Google)22 Mar 2008 13:24 
Subject:Getting timezone and "where" from public calendars using Zend?
From:Daniel Karp (dani@gmail.com)
Date:03/21/2008 07:51:17 AM
List:com.googlegroups.google-calendar-help-dataapi

I'm hoping to find a more elegant solution to a problem I've already solved sort of the hard way. I'm trying to get information from public calendar feeds, including timezone and "where". My code currently is:

$gdata = new Zend_Gdata(); $query= new Zend_Gdata_Query($args['gcalcalendarid']); $feed = $gdata->getFeed($query); $calendar['title'] = $feed->title->text; $calendar['description'] = $feed->subtitle->text; foreach ( $feed->extensionElements as $element ) { if ($element->rootElement == 'timezone') { $calendar['timezone'] = $element->extensionAttributes['value'] ['value']; } if ($element->rootElement == 'where') { $calendar['location'] = $element->extensionAttributes['valueString'] ['value']; } } return $calendar;

This definitely works, but there must be a better way to get at those namespaced elements other than drilling down through object like that. I haven't been able to find anything that works for me in the documentation, though. Any thoughts?