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: 

Reading An HTML File with ReadAsciiFile?

I'm using the MRSS template.
In the main.brs, I have changed the line that uses ReadAsciiFile to read the config.opml from a URL location, thusly:


raw = roURLTransfer("http://www.clearperception.org/wordchannel/config.opml")


However, the file does not seem to be getting read, as the channel will not play in Roku.

The config.opml does exist at that URL location, though.

So, my question is this: How can I make this work, so the config.opml file does not have to be part of the package?

(NOTE: I have also experimented with the videoplayer example, and can point to a URL location for the category.xml file just fine)

Thx!

-
Bruce
0 Kudos
3 REPLIES 3
renojim
Community Streaming Expert

Re: Reading An HTML File with ReadAsciiFile?

xfer = CreateObject("roUrlTransfer")
xfer.SetUrl("http://www.clearperception.org/wordchannel/config.opml")
raw = xfer.GetToString()

It's all in the documentation for roUrlTransfer.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos

Re: Reading An HTML File with ReadAsciiFile?

JT,

Thanks for the example code.

Ya know, it is odd that I searched on "("http:" in the Brightscript PDF file that came with the SDK and never found anything.
Is this kind of thing documented in a different PDF file?

-
Bruce
0 Kudos
renojim
Community Streaming Expert

Re: Reading An HTML File with ReadAsciiFile?

You want to be looking at the Component Reference. The BrightScript reference mostly just has language elements.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos