PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Zend Framework 101: Zend_Gdata_YouTube

This article is part of the series “Zend Framework 101”. The Zend Framework 101 series covers many components that make up the Zend Framework in easy to understand articles.. Read more about Zend Framework 101...

Introduction

The Zend Framework contains a number of APIs for accessing Google services, including YouTube. In this article I will show you how to retrieve a feed of videos from YouTube using the Zend_Gdata_YouTube class within Zend_Gdata.

There are a number of different feeds available, and different types of data available in each feed. For instance, some data is only available if you connect to the service with your developer tokens.

To simplify things in this article, we're going to use the service to retrieve videos for a specific user, and we're going to do so using anonymous authentication. You can refer to the developer guide (linked below) for details on other types of queries that can be performed.

In this article we will cover the following:

  • Retrieve a list of videos for a given username
  • Loop over the videos and output details of each
  • Use an advanced query to split results up into pages

This article requires Zend Framework, downloadable from http://framework.zend.com. At time of writing, the current version of Zend Framework is 1.10.5.

In addition to this article, you can find out about the Zend_Gdata_YouTube component from Zend Framework developer guide.

In This Article