如何使用zend-gdata检索用户配置文件信息


How to retrieve the user profile information using zend gdata

我已经使用oauth(使用了zend-gdata库)对youtube用户进行了身份验证。

$url = Zend_Gdata_AuthSub::getAuthSubTokenUri($returnUrl, $this->scope, $this->isSecure, $this->isSession);
$httpClient = Zend_Gdata_AuthSub::getHttpClient(Yii::app()->user->sessionToken);

如何检索用户配置文件信息(我需要他/她的用户名)?从zend-gdata文档中,我发现了以下代码:

$yt = new Zend_Gdata_YouTube();
$userProfile = $yt->getUserProfile('liz');

但是,使用oauth身份验证,我无法检索用户名。

我刚刚遇到了同样的问题,发现解决方案隐藏在这些响应中

$yt->getUserProfile("default")->username->text;

这将为您获取当前已验证用户的用户名