for each item in xml.channel.item
newItem = {
streams: []
streamFormat: "mp4"
actors: []
categories: []
contentType: "episode"
}
xml = CreateObject("roXMLElement")
if xml.Parse(raw)
for each item in xml.channel.item
newItem = {
streams: []
streamFormat: []
actors: []
categories: []
contentType: "episode"
}
' title
tmp = item.GetNamedElements("media:title")
if tmp.Count() > 0
newItem.title = util.HTMLEntityDecode(ValidStr(tmp[0].GetText()))
newItem.shortDescriptionLine1 = util.HTMLEntityDecode(ValidStr(tmp[0].GetText()))
else
newItem.title = util.HTMLEntityDecode(ValidStr(item.title.GetText()))
newItem.shortDescriptionLine1 = util.HTMLEntityDecode(ValidStr(item.title.GetText()))
end if
' streamFormat
if item.enclosure.count() > 0
for each enclosure in item.enclosure
if item.enclosure@type = "hls"
fileFormat = "hls"
else if item.enclosure@type = "video/x-mp4"
fileFormat = "mp4"
else if item.enclosure@type = "video/mp4"
fileFormat = "mp4"
else if fileFormat = ""
end if
newItem.streamFormat = fileFormat
end for
end if
<outline title="Live Video" subtitle="Watch live content from ####" img="http://www.####.com/LiveVideoHD.png" url="http://www.####.com/streaming.xml"/>
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
<title>####</title>
<link>http://www.####.com</link>
<description></description>
<item>
<title>Live Newscast</title>
<category>Streaming Video</category>
<description>We're proud to be the only news station in #### to offer live streaming on your Roku.</description>
<streamformat>hls</streamformat>
<media:content url="http://www.###.com/master.m3u8"/>
<media:thumbnail url="http://www.####.com/StreamingHD.png" />
</item>
</channel>
</rss>
' streamformat
if item.GetNamedElements("streamformat").Count() > 0
tmp = item.GetNamedElements("streamformat")
newItem.streamformat = ValidStr(tmp[0].GetText())
end if
"http wrote:
type is the standard MIME type of the object. It is an optional attribute.
xml = CreateObject("roXMLElement")
if xml.Parse(raw)
for each item in xml.channel.item
newItem = {
streams: []
streamFormat: []
Live: []
actors: []
categories: []
contentType: "episode"
}