Sto scrivendo una classe per gestire i feed di youtube... grrrrrr (nn ho mai il tempo di finirla!!). Prova così:
Codice PHP:
<?php
function download_page($path){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$path);
curl_setopt($ch, CURLOPT_FAILONERROR,1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
$retValue = curl_exec($ch);
curl_close($ch);
return $retValue;
}
$url='http://gdata.youtube.com/feeds/api/videos?q=football+-soccer&orderby=published&start-index=11&max-results=10&v=2';
$sXML = download_page(url);
$oXML = new SimpleXMLElement($sXML);
//da qui in poi non so che fare
foreach($oXML->entry as $oEntry){
$array_url = (string) explode('/', $oEntry->id);
$id_video = end($array_url);
echo $id_video;
}