Probably it will be posted twice, but the first one seems to got lost
in cyberspace...
So still no luck.
I beleive I do everything correctly:
-login my account (I can list all my calendars, so it must ork)
-create an event into one of my calendars - not the main one (it
works, I checked the created event on Calendars and it appears well)
-retrieve the events from my calendar, the eventFeed has one item, it
contains my newly created event)
-when I try to use the Delete() method, I get a Fatal Error:
<b>Fatal error</b>: Uncaught exception 'Zend_Gdata_App_HttpException'
with message 'Expected response code 200, got 500' in /home/gkovacsp/
scripts/Zend/Gdata/App.php:581
Stack trace:
#0 /home/gkovacsp/scripts/Zend/Gdata/App/Entry.php(191):
Zend_Gdata_App->delete(Object(Zend_Gdata_Calendar_EventEntry))
#1 /home/gkovacsp/misc/epguides/test.php(68): Zend_Gdata_App_Entry-
>delete()
#2 {main}
thrown in <b>/home/gkovacsp/scripts/Zend/Gdata/App.php</b> on line
<b>581</b><br />
Please help me to solve this misterious problem.
Thanks a lot
<?php
header("Content-type: text/html; charset=utf-8");
$calendarID = "kovacs-
[EMAIL PROTECTED]";
$calendarURL="http://www.google.com/calendar/feeds/".$calendarID."/
private/full";
require_once '../../scripts/Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_AuthSub');
Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
$service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = '[EMAIL PROTECTED]'; //this is my google account
$pass = 'mypassword';
// Create an authenticated HTTP client
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass,
$service);
// Create an instance of the Calendar service
$service = new Zend_Gdata_Calendar($client);
//Create new event
$event= $service->newEventEntry();
// Populate the event with the desired information
$event->title = $service->newTitle("My Event");
$event->where = array($service->newWhere("At home"));
$event->content = $service->newContent("This event was created
through PHP");
// Set the date using RFC 3339 format.
$startDate = "2007-11-15";
$startTime = "14:00";
$endDate = "2007-11-15";
$endTime = "16:00";
$tzOffset = "+01";
$when = $service->newWhen();
$when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$event->when = array($when);
// Upload the event to the calendar server
$newEvent = $service->insertEvent($event,$calendarURL);
//Query events
$query = $service->newEventQuery();
$query->setUser($calendarID);
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setStartMin('2007-01-01');
$query->setStartMax('2007-12-31');
// Retrieve the event list from the calendar server
try {
$eventFeed = $service->getCalendarEventFeed($query);
} catch (Zend_Gdata_App_Exception $e) {
echo "Error: " . $e->getResponse();
}
print "Number of events within eventFeed: ".count($eventFeed);
// Iterate through the list of events, outputting them as an HTML
list
echo "<ul>";
foreach ($eventFeed as $event) {
echo "<li>" . $event->title . " (Event ID: " . $event->id . ")</
li>";
$event->delete(); // <-- This is where the Fatal Error Occurs
}
echo "</ul>";
?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---