require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Gdata_Calendar'); Zend_Loader::loadClass('Zend_Gdata_Calendar_EventEntry'); $client = Zend_Gdata_ClientLogin::getHttpClient('username', 'password', 'cl'); $service = new Zend_Gdata_Calendar($client); $event = new Zend_Gdata_Calendar_EventEntry(); $event->title = $service->newTitle('My Event'); $event->where = array($service->newWhere('my location')); $start = $service->newWhen(); $start->startTime = '2014-09-10T10:00:00.000Z'; $start->endTime = '2014-09-10T14:00:00.000Z'; $event->when = array($start); $newEvent = $service->insertEvent($event);
require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Gdata_Query'); Zend_Loader::loadClass('Zend_Gdata_Feed'); $client = Zend_Gdata_ClientLogin::getHttpClient('username', 'password', 'cp'); $service = new Zend_Gdata($client); $query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/default/full'); $feed = $service->getFeed($query); foreach ($feed->entry as $entry) { echo $entry->title->text . "\n"; }This example shows how to read contacts from Google Contacts using the Zend_Gdata_Extension library. It uses a Zend_Gdata_Query object to specify the URL of the contacts feed. The getFeed() method retrieves the feed, and we can loop through its entries to read the contact information. In conclusion, the Zend_Gdata_Extension library is a PHP package that extends the functionality of the Zend_Gdata library for interacting with Google services. Its examples encompass various Google services like Calendar, Contacts, and Spreadsheets.