谷歌已经用他们的日历API找到了一些东西,现在我需要修复一些将自己添加到文本中的奇怪符号。我发现这个线程这正好说明我处理这个问题: http://www.google.com/support/forum/p/Calendar/thread?tid=25ac3d762b235a51&hl=en如何将querystring追加到对象?
解决的办法是追加“& HL = en”或“HL =恩?”我的“基本” URL加料结束。
我confunsed如何做到这一点,虽然,因为我检索饲料与Zend_Gdata对象:
<?php
// load library
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');
// create authenticated HTTP client for Calendar service
$gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
$user = "xxxxx";
$pass = "xxxxx";
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);
$gcal = new Zend_Gdata_Calendar($client);
$query = $gcal->newEventQuery();
$query->setUser('[email protected]');
$secondary=true;
$query->setVisibility('private');
$query->setProjection('basic');
$query->setOrderby('starttime');
$query->setSortOrder('ascending');
//$query->setFutureevents('true');
$startDate=date('Y-m-d h:i:s');
$endDate="2015-12-31";
$query->setStartMin($startDate);
$query->setStartMax($endDate);
$query->setMaxResults(30);
try {
$feed = $gcal->getCalendarEventFeed($query);
} catch (Zend_Gdata_App_Exception $e) {
echo "Error: " . $e->getResponse();
}
?>
我试过,没有运气做到这一点:
$query->setProjection('basic?hl=en');
嘿,伙计,那工作!非常感谢! – Joel 2011-03-20 07:23:16