On Wed, Feb 4, 2009 at 9:18 AM, Bob <[email protected]> wrote:
>
> I am building a site that will allow programmatic access to read/
> update 9 calendars. All the calendars are grouped on a single gmail
> account.
>
> I have searched for several hours to find some docs on this questions,
> but no luck...so here goes:
>
> I have no problem getting title data for all the calendars in the
> group (url: [email protected]) using the code below. What I
> can't figure out how to do is to access the events on other calendars
> in the group...all of the docs I've been able to find only show how to
> access events for the primary calendar.
>
> Any help would be greatly appreciated!
> TIA
> Bob
>
> Code
> ===============================
> require_once 'Zend/Loader.php';
> Zend_Loader::loadClass('Zend_Gdata');
> Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
> Zend_Loader::loadClass('Zend_Gdata_Calendar');
>
> $usr = '[email protected]';
> $pwd = 'password';
> $svc = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
> $client = Zend_Gdata_ClientLogin::getHttpClient($usr, $pwd, $svc);
>
> $gdataCal = new Zend_Gdata_Calendar($client);
> $calFeed = $gdataCal->getCalendarListFeed();
>
> echo '<h1>' . $calFeed->title->text . '</h1>';
> echo '<ul>';
> foreach($calFeed as $calendar) {
> echo '<li>' . $calendar->title->text . '</li>';
> }
> echo '</ul>';
>
Bob,
You'll need to retrieve your list of Calendars as described here:
http://code.google.com/apis/calendar/docs/1.0/developers_guide_php.html#RetrievingCalendars
then extract the <link rel="alternate"> URI from the entry
representing the calendar you want to access. You can then pass this
URI into getCalendarListFeed() as an argument to request the data for
that calendar.
--
Trevor Johns
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---