Hey everyone,
I have modified my PHP web app to add events to a Google Calendar. Currently, it adds successfully.
However, now I wish to delete and edit events. This seems easy to do, except for the fact that I don't know what event URL is associated with each event.
Am I supposed to set this event URL (or ID?) upon adding an event? How am I supposed to figure out what it is?
I can't seem to find this information anywhere else...
Thanks!
EDIT:
I have been using the Zend Framework for this (Gdata package)...
EDIT:
$newIncludePath = array();
$newIncludePath[] = '../ZendGdata-1.8.4PL1/library';
$newIncludePath = implode($newIncludePath);
set_include_path($newIncludePath);
// load classes
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_Http_Client');
// connect to service
$gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = "********@gmail.com";
$pass = "*****";
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);
$gcal = new Zend_Gdata_Calendar($client);
// construct event object
// save to server
try {
$event = $gcal->newEventEntry();
$event->title = $gcal->newTitle($title);
$event->content = $gcal->newContent($desc);
$when = $gcal->newWhen();
$when->startTime = $date;
$when->endTime = $date;
$event->when = array($when);
$gcal->insertEvent($event);
echo $event->getEditLink()->href;
} catch (Zend_Gdata_App_Exception $e) {
echo "Error: Unable to add event to Google Calendar" . $e->getResponse();
}