« Return to Thread: Newbie question - getFeed not working

Re: Newbie question - getFeed not working

by Ryan Boyd (Google) :: Rate this Message:

Reply to Author | View in Thread

Hi Adrian,

Why do you believe the last line is not getting executed?

The following code works for me to print out the name of the videos.

Note: to get some of the data other than simple things like video titles will require navigating the extension elements.  This might be a little difficult if you're new to PHP.  We're working on adding specific support and samples for YouTube:
http://framework.zend.com/issues/browse/ZF-1918

If you want to get the extension elements, call:
$extensions = $entry->getExtensionElements();

That'll give you an array of Zend_Gdata_App_Extension_Element objects:
http://framework.zend.com/apidoc/core/Zend_Gdata/Zend_Gdata_App_Extension_Element.html

<?php
require_once 'Zend/Loader.php';

Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Query');

$gdata = new Zend_Gdata ();
$query = new Zend_Gdata_Query(' http://gdata.youtube.com/feeds/standardfeeds/top_rated');
$feed = $gdata->getFeed($query);
foreach ($feed as $entry) {
  echo $entry->getTitle()->text . "<br />";
}
?>


On 9/7/07, adriank <adrian@...> wrote:

Hi!

I´m new to Zend Framework (quite new to PHP also :-). I wrote my first piece
of code, and it's not working:

require_once 'Zend/Loader.php';

Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_Query');

$gdata = new Zend_Gdata ();
$query = new Zend_Gdata_Query
('http://gdata.youtube.com/feeds/standardfeeds/top_rated' );
$feed = $gdata->getFeed($query);

It executes everything but the last line. Any ideas?

Thanx

Adrian

--
View this message in context: http://www.nabble.com/Newbie-question---getFeed-not-working-tf4403595s16154.html#a12562668
Sent from the Zend gdata mailing list archive at Nabble.com.


 « Return to Thread: Newbie question - getFeed not working