php zend gdata - Get list of google docs using oauth

让人想犯罪 __ 提交于 2019-11-30 14:35:10

问题


I've got my session with the valid token that i set up this way :

$session_token = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']);
// Store the session token in our session.
$_SESSION['cal_token'] = $session_token;

Then i want to be able to do this:

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

But using the token. Instead of the authentication with user/pass/service

I already looked at some example of this but i didn't find any way to make it work.

Thank you everyone!


回答1:


    // 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";
    }


来源:https://stackoverflow.com/questions/10253490/php-zend-gdata-get-list-of-google-docs-using-oauth

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!