try { $client = Zend_Gdata_ClientLogin::getHttpClient($username, $password); } catch(Zend_Gdata_App_Exception $ex) { // 例外の内容をユーザに報告します die($ex->getMessage()); }
$gdataCal = new Zend_Gdata_Calendar($client); $calFeed = $gdataCal->getCalendarListFeed(); echo "<h1>" . $calFeed->title->text . "</h1>\n"; echo "<ul>\n"; foreach ($calFeed as $calendar) { preg_match("/\/([^\/]+)$/i",$calendar->id->text,$match); echo $calendar->title->text . "のカレンダーID:" . $match[1] . "<br />\n"; } echo "</ul>\n"
$query = $service->newEventQuery(); $query->setUser(カレンダーID);
$ wget http://framework.zend.com/releases/ZendGdata-1.10.1/ZendGdata-1.10.1.zip $ unzip ZendGdata-1.10.1.zip $ cd ZendGdata-1.10.1/demos/Zend/Gdata/ $ vi Calendar.php ---- ini_set('include_path', ini_get('include_path') . ':/path/to/ZendGdata-1.10.1/library'); ---- $ php -q Calendar.php Usage: php Calendar.php <action> [<username>] [<password>] [<arg1> <arg2> ...] Possible action values include: outputCalendar outputCalendarMagicCookie outputCalendarByDateRange outputCalendarByFullTextQuery outputCalendarList updateEvent deleteEventById deleteEventByUrl createEvent createQuickAddEvent createWebContentEvent createRecurringEvent setReminder addExtendedProperty
$ php -q Calendar.php outputCalendarList 'YOUR_ACCOUNT' 'YOUR_PASSWORD' <h1>dex404@gmail.com's Calendar List</h1> <ul> <li>test</li> <li>日本の祝日</li> <li>週番号</li> </ul>