xoceunder
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2017
01:50 PM
separate from the xml file each category with its item to show
Helps you pull out content to show
My content http://144.217.94.67/xml/series.xml
My function to display content in the grid scene
But I want to be able to make it possible to place each category the name with its content as it could make this possible
My content http://144.217.94.67/xml/series.xml
My function to display content in the grid scene
Function GetDataMovies()
readInternet=createObject("roUrlTransfer")
readInternet.setUrl(m.top.uri)
source=readInternet.GetToString()
responseXML=ParseXML(source)
responseXML=responseXML.GetChildElements()
responseArray=responseXML.GetChildElements()
oneRow=[]
twoRow=[]
c=0
For Each xmlItem In responseArray
If xmlItem.getName()="item"
itemAA=xmlItem.GetChildElements()
If itemAA<>invalid
item={}
For Each xmlItem In itemAA
item[xmlItem.getName()]=xmlItem.getText()
If xmlItem.getName()="media:content"
item.url=xmlItem.getAttributes().url
item.streamFormat="mp4"
mediaContent=xmlItem.GetChildElements()
For Each mediaContentItem In mediaContent
If mediaContentItem.getName()="media:thumbnail"
item.HDPosterUrl=mediaContentItem.getattributes().url
item.hdBackgroundImageUrl=mediaContentItem.getattributes().url
End If
Next
End If
Next
If (c/2)=Int(c/2)
oneRow.Push(item)
Else
twoRow.Push(item)
End If
c=c+1
End If
End If
Next
list=[
{
TITLE : "First row"
ContentList : oneRow
}
{
TITLE : "Second row"
ContentList : twoRow
}
]
RowItems=createObject("RoSGNode","ContentNode")
For x=0 To list.Count()-1
row=createObject("RoSGNode","ContentNode")
row.Title=list[x].Title
For Each itemAA In list[x].ContentList
item=createObject("RoSGNode","ContentNode")
item.Title=itemAA.Title
item.description=itemAA.description
item.url=itemAA.url
item.streamFormat="mp4"
item.releasedate=itemAA.pubDate
item.HDPosterURL=itemaa.HDPosterURL
item.hdbackgroundimageurl=itemaa.hdbackgroundimageurl
row.AppendChild(item) 'Add each individual item
End For
RowItems.AppendChild(row) 'Add each individual category of items
Next
m.top.content=RowItems 'set top content field to the entire screen's content which will cause the content observer to notice
End Function
But I want to be able to make it possible to place each category the name with its content as it could make this possible
2 REPLIES 2
xoceunder
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2017
10:11 PM
Re: Helps you pull out content to show
How can i separate from the xml file each category with its item to show in GridScreen
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2017
09:15 AM
Re: separate from the xml file each category with its item to show
Just if anyone else using the sample feed for this - how to dynamically get the category names from a feed based on that link above -
Function GetDataMovies()
readInternet=createObject("roUrlTransfer")
readInternet.setUrl(m.top.uri)
source=readInternet.GetToString()
responseXML=ParseXML(source)
responseXML=responseXML.GetChildElements()
responseArray=responseXML.GetChildElements()
content=[]
CategoryNames=[]
numofcategories=responsearray.Count()-1
For c=1 To numofcategories
CategoryNames.Push(responsearray[c]@name)
temparray=[]
For x=0 To responsearray[c].item.Count()-1
itemAA=responsearray[c].item[x].GetChildElements()
item={}
For Each xmlItem In itemAA
item[xmlItem.getName()]=xmlItem.getText()
If xmlItem.getName()="media:content"
item.url=xmlItem.getAttributes().url
item.streamFormat="mp4"
mediaContent=xmlItem.GetChildElements()
For Each mediaContentItem In mediaContent
If mediaContentItem.getName()="media:thumbnail"
item.HDPosterUrl=mediaContentItem.getattributes().url
item.hdBackgroundImageUrl=mediaContentItem.getattributes().url
End If
Next
End If
Next
temparray.Push(item)
Next
content.Push(temparray)
Next
RowItems=createObject("RoSGNode","ContentNode")
For x=0 To CategoryNames.Count()-1
row=createObject("RoSGNode","ContentNode")
row.Title=CategoryNames[x]
For Each itemAA In content[x]
item=createObject("RoSGNode","ContentNode")
item.Title=itemAA.Title
item.description=itemAA.description
item.url=itemAA.url
item.streamFormat="mp4"
item.releasedate=itemAA.pubDate
item.HDPosterURL=itemaa.HDPosterURL
item.hdbackgroundimageurl=itemaa.hdbackgroundimageurl
row.AppendChild(item) 'Add each individual item
Next
RowItems.AppendChild(row) 'Add each individual category of items
Next
m.top.content=RowItems 'set top content field to the entire screen's content which will cause the content observer to notice
End Function