'
' 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