どのように私はGoogleカレンダー内のすべての最近更新されたイベントを取得するのですか?
-
18-09-2019 - |
質問
私は現在、私たち自身のカレンダーアプリでとGoogleカレンダーアプリに同期することになっているGoogleカレンダー同期機能に取り組んでいます。今私は私が私たちのカレンダーアプリにこれらのイベントをコピーすることができますので、Googleカレンダーでの最近の変化を確認する必要があります。しかし私は、私には理解される任意のアイデアをZendのGDATAを使用します。
解決
( http://framework.zend.com/から変更マニュアル/ EN / zend.gdata.calendar.html の)
$query = $service->newEventQuery();
$query->setUser('default');
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setFutureevents('true');
// Subtract time frame for when you want to detect
// updated events, for example, in the past 24 hrs
$refresh = time() - 60*60*24;
$refresh_date = date('Y-m-dTH:i:sP', $refresh);
$query->setUpdatedMin($refresh_date);
// Retrieve the event list from the calendar server
try {
$eventFeed = $service->getCalendarEventFeed($query);
} catch (Zend_Gdata_App_Exception $e) {
echo "Error: " . $e->getMessage();
}
// 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>";
}
echo "</ul>";
所属していません StackOverflow