Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
astromo
Level 7

How to extract video links from Youtube RSS feed

I can get the youtube rss feed from the youtube playlist as explained in
http://www.qubesys.com/how-to-get-youtu ... -rss-link/
And I can display youtube videos on Roku by following the guideline in
viewtopic.php?f=34&t=45537

How can I extract video links from the youtube rss feed? I tried "readasciifile" but it didn't work. Any help will be very much appreciated.
0 Kudos
2 REPLIES 2\
belltown
Level 9

Re: How to extract video links from Youtube RSS feed


'
' Returns an array with one element for each video. Each element in the array is an associative array with fields
' videoTitle and videoUrl.
'
function getRSSFeed (feedUrl as string) as object
urlTransferObject = CreateObject ("roUrlTransfer")
urlTransferObject.SetPort (CreateObject ("roMessagePort"))
urlTransferObject.SetUrl (feedUrl)
urlData = urlTransferObject.GetToString ()
xml = CreateObject ("roXMLElement")
xml.Parse (urlData)
videoList = []
for each entry in xml.Entry
for each entryChild in entry.GetChildElements ()
if entryChild.GetName () = "media:group"
for each mediaGroupChild in entryChild.GetChildElements ()
if mediaGroupChild.GetName () = "mediaSmiley Tonguelayer"
videoList.Push ({videoTitle: entry.title.GetText (), videoUrl: mediaGroupChild@url})
exit for
endif
end for
exit for
endif
end for
end for
return videoList
end function
https://github.com/belltown/
0 Kudos
astromo
Level 7

Re: How to extract video links from Youtube RSS feed

belltown, Thanks a lot. You save my day.
0 Kudos