I'm still fighting this code - please help me...
I'm trying to strip down everything to find where the problem is:
-I can log in to my calendar and create an event in the selected
calendar via PHP (I've double checked, it does show up in the
calendar)
-I can retrieve this event from my calendar via PHP (I've checked the
returned $eventFeed, it contains one event and that is the event I
created just earlier)
-I iterate through the events in my $eventFeed and try to use the
delete() method on them and here I run in to this permanent problem
I receive a Fatal Error from Zend/Gdata/App.php on line 581.
(This is the full response I get: <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 />)
This is the full PHP code I use:
<?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
-~----------~----~----~----~------~----~------~--~---