MikeL1
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
06:33 PM
Simple Quesiton on URLs
I am trying to learn Roku channel development. I took the "videoplayer" example and was going to experiment with the category feeds. I discovered that the category files were present in the application's tree as well as online, and I changed the line:
to
to pull the local copy of the file instead of hitting the web server at rokudev.roku.com. The only other change i made was to add a debugging line after the "Can't parse feed" so I could see the results of the fetch of the URL:
It looks like the HTTP fetch returns nothing:
Any clues on what I'm doing wrong?
conn.UrlPrefix = "http://rokudev.roku.com/rokudev/examples/videoplayer/xml"
to
conn.UrlPrefix = "file://pkg:/xml"
to pull the local copy of the file instead of hitting the web server at rokudev.roku.com. The only other change i made was to add a debugging line after the "Can't parse feed" so I could see the results of the fetch of the URL:
if not xml.Parse(rsp) then
print "Can't parse feed"
print "'" + rsp + "'"
return invalid
endif
It looks like the HTTP fetch returns nothing:
created feed connection for file://pkg:/xml/categories.xml
url: file:///tmp/plugin/FDAAAA1tnmYw/pkg:/xml/categories.xml
Took: 5ms
Can't parse feed
''
Any clues on what I'm doing wrong?
8 REPLIES 8
RokuChris
Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
06:53 PM
Re: Simple Quesiton on URLs
Two things. First, the path should look more like this:
Also, you can't read a local file using roURLTransfer. You'll need to use ReadASCIIFile() as documented on p34 of the BrightScript Reference Manual.
conn.UrlPrefix = "pkg:/xml"
Also, you can't read a local file using roURLTransfer. You'll need to use ReadASCIIFile() as documented on p34 of the BrightScript Reference Manual.
MikeL1
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
07:36 PM
Re: Simple Quesiton on URLs
Thanks for the quick response. Added the following line after
No joy in mudville. The app doesn't seem to run at all - connecting to the debug port 8085 yields nothing.
xml=CreateObject("roXMLElement")
rsp = ReadAsciiFile("pkg:/xml/categories.xml")
if not xml.Parse(rsp)
'...
No joy in mudville. The app doesn't seem to run at all - connecting to the debug port 8085 yields nothing.
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
07:41 PM
Re: Simple Quesiton on URLs
"MikeL1" wrote:
No joy in mudville. The app doesn't seem to run at all - connecting to the debug port 8085 yields nothing.
At a minimum is should state it's running the code, and it should give you an error message and the debugging console if there's an error. Sometimes it seems the debugging port can get stuck for me (if, for example, I let the computer go to sleep and time out the telnet connection), and I need to reset the Roku.
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!
MikeL1
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
07:45 PM
Re: Simple Quesiton on URLs
Thanks, will try rebooting.
MikeL1
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
08:25 PM
Re: Simple Quesiton on URLs
Post-reboot I actually get it to install and get debugging output but it's not reading the file:
gives me the following:
xml=CreateObject("roXMLElement")
rsp = ReadAsciiFile("pkg:/xml/categories.xml")
if not xml.Parse(rsp)
print "Can't parse feed"
print "Rsp = '" + rsp + "'"
return invalid
endif
gives me the following:
Can't parse feed
Rsp = ''
RokuChris
Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
08:32 PM
Re: Simple Quesiton on URLs
If you're using included makefile to package and install the sample channel, the xml directory will be excluded from the package, which could cause the problem you're seeing.
MikeL1
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2011
08:45 PM
Re: Simple Quesiton on URLs
Doh! Should have done more checking, but I'm new to this. That did the trick. Hopefully I wont' be pestering you all anymore (at least not for a while).
Thank you!
Thank you!
MikeL1
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-06-2011
08:31 AM
Re: Simple Quesiton on URLs
"RokuChris" wrote:
Also, you can't read a local file using roURLTransfer. You'll need to use ReadASCIIFile() as documented on p34 of the BrightScript Reference Manual.
FYI you can read a local file using roURLTransfer just as with a web browser, the URL syntax is "file://pkg:/xml/categories.xml".