开发者

Fetch Youtube Private videos using gdata API

I want a simple way so retrieve all user's uploads on Youtube including private videos. I'm using PHP and gdata API, and I do not want to use Zend Gdata.

Any 开发者_如何学JAVAideas or approaches to do that ?


You can use Zend Gdata as a 'generic solution'. For example in this code snippet, I am getting the number of views of this video. No need for use with the Zend framework. As you can see I am using the PHP CLI for this one:

php > require_once 'Zend/Uri/Http.php';
php > require_once 'Zend/Gdata/YouTube.php';
php > $x = new Zend_Gdata_YouTube();
php > $x->setMajorProtocolVersion(2);
php > $v = $x->getVideoEntry("zZ5tt6_guR4")->getVideoViewCount();
php > echo $v;
1874357

For your purposes, you can see more details on how to use it over here.

The key is to include the necessary php files. In my example btw, my Zend files are on the include path.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜