parsing youtube xml

View: New views
2 Messages — Rating Filter:   Alert me  

parsing youtube xml

by Jonathan Vanherpe (T & T NV) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi list,

does anyone know why this code returns an empty array?

<?Lassoscript
var('youtube_id')='oHg5SJYRHA0';
var('youtube_xml')=xml(include_url('http://gdata.youtube.com/feeds/api/videos/'+$youtube_id));
'title: '+encode_HTML($youtube_xml->extract('/entry/title'));
?>

thanks,
Jonathan
--
Jonathan Vanherpe - Tallieu & Tallieu NV - jonathan@...

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/



Re: parsing youtube xml

by Jonathan Vanherpe (T & T NV) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Jonathan Vanherpe (T & T NV) wrote:

> Hi list,
>
> does anyone know why this code returns an empty array?
>
> <?Lassoscript
> var('youtube_id')='oHg5SJYRHA0';
> var('youtube_xml')=xml(include_url('http://gdata.youtube.com/feeds/api/videos/'+$youtube_id)); 
>
> 'title: '+encode_HTML($youtube_xml->extract('/entry/title'));
> ?>
>
> thanks,
> Jonathan

found the answer myself in this ToTW:
http://www.lassosoft.com/Documentation/TotW/index.lasso?9008
I needed to use this:
'title:
'+encode_HTML($youtube_xml->extractOne('//*[name()="title"]/text()'));

Jonathan
--
Jonathan Vanherpe - Tallieu & Tallieu NV - jonathan@...

--
This list is a free service of LassoSoft: http://www.LassoSoft.com/
Search the list archives: http://www.ListSearch.com/Lasso/Browse/
Manage your subscription: http://www.ListSearch.com/Lasso/