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: 
kooljay68
Visitor

DeviantArt example no rss but with xml file

I am very new to all this and not the worlds best programmer by any means. But I am learning as best I can and I cannot for the life of me figure out how to convert the deviantArt example to use just and XML file (and with what data) instead of an RSS feed?

Any help would be great.

Thank you
0 Kudos
2 REPLIES 2
kooljay68
Visitor

Re: DeviantArt example no rss but with xml file


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<feed>

<!-- resultLength indicates the total number of results for this feed -->

<resultLength>4</resultLength>

<!-- endIndix indicates the number of results for this *paged* section of the feed -->

<endIndex>4</endIndex>

<item>
<title>Private</title>
<URL>http://allbabestv.com/roku/img/10001.jpg</URL>
</item>

<item>
<title>Private</title>
<URL>http://allbabestv.com/roku/img/10002.jpg</URL>
</item>

<item>
<title>Private</title>
<URL>http://allbabestv.com/roku/img/10003.jpg</URL>
</item>

<item>
<title>Private</title>
<URL>http://allbabestv.com/roku/img/10004.jpg</URL>
</item>


</feed>


Why can I not just get the example to read a file like this ???
0 Kudos
RokuRobB
Streaming Star

Re: DeviantArt example no rss but with xml file

Here is some sample code that reads teh contents of your XML. Add the XML as feed.xml to a folder called xml in the channel package and you should be good to go:

Function loadXml() as void
feed = CreateObject("roXMLElement")
feed.Parse(ReadAsciiFile("pkg:/xml/feed.xml"))
resultLength = feed.resultLength.GetText()

for each item in feed.item
print "Title: " + item.title.GetText()
print "URL: " + item.URL.GetText()
end for
End Function
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.