Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
astromo
Visitor

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
Roku Guru

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 () = "media:player"
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
0 Kudos
astromo
Visitor

Re: How to extract video links from Youtube RSS feed

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