I want to be able to read the favorite videos of a user from youtube using the youtube-api in php. So far I have this:
index.php `
<?php
require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path
Zend_Loader::loadClass('Zend_Gdata_YouTube');
$yt = new Zend_Gdata_YouTube();
$yt->setMajorProtocolVersion(2);
$favoritesFeed = $yt->getUserFavorites('cartmanland911');
foreach($activityFeed as $activityEntry) {
$title = $activityEntry->getVideoTitle();
echo "favorited video " . $title . '<br/>';
}
?>`
The zend framework is in the same folder as the index.php file and the framework loads ok.
Calling echo $favoritesFeed->getDOM()->hasChildNodes();
outputs 1
Also, calling echo $favoritesFeed->count();
outputs 6 which is correct(i have 6 favorite videos)
So, the question is how do I read the name of each of those favorite videos?
EDIT: Added another solution above.