2012-04-20 77 views
1

我有我與我建立這種方式有效令牌會話獲取谷歌文檔列表的PHP Zend GDATA使用OAuth

$service = Zend_Gdata_Docs::AUTH_SERVICE_NAME; 
$client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service); 
$docs = new Zend_Gdata_Docs($client); 
$feed = $docs->getDocumentListFeed(); 

但是使用令牌。相反,與用戶名/密碼/服務

認證的我已經看了看這一些示例,但我沒有發現任何方式使其工作。

謝謝大家!

回答

5
// Retrieve user's list of Google Docs 
    $client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['cal_token']); 
    $docs = new Zend_Gdata_Docs($client); 
    $feed = $docs->getDocumentListFeed(); 
    foreach ($feed->entries as $entry) { 
     echo "$entry->title\n"; 
    }