destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2011
02:57 PM
Parse XML in chunks?
To eliminate the memory limit of the Roku boxes, is it possible to parse an RSS feed in pieces, rather than having to parse the entire thing? And how could you resume parsing when needed later in the script?
Or is truly the best solution to use mysql and do a limit query?
Or is truly the best solution to use mysql and do a limit query?
4 REPLIES 4
kbenson
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2011
07:36 PM
Re: Parse XML in chunks?
I imagine if you need, you could use a regular expression to break the downloaded RSS into chunks without too much trouble. If you post a sample, I'd be happy to help.
-- GandK Labs
Check out Reversi! in the channel store!
Check out Reversi! in the channel store!
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2011
07:46 AM
Re: Parse XML in chunks?
I'm still trying to get a feel for how this works. I ran across this post which makes me worry about the memory limit - viewtopic.php?f=34&t=35105&p=226658&hilit=out+of+memory+xml#p226658
There aren't any specifications as to how much ram each roku device ships with, how fast the processor is, etc etc, so for now I have the following questions:
When downloading an XML, what is the size of the storage area for the source file? ie - if I download a 3MB XML to parse, or pick and choose what data to add to an array, what would be the file size limit to hold the source xml?
Does all the XML need to exist before the screen is displayed, or can I have it load the episode xml based on which category is selected?
Most of the examples use static data - is there a better dynamic example available anywhere besides deviantart and/or the video player?
Does the size of a url matter in a content list as far as memory goes? - ie is there any ram benefit to using a url shortening service like tinyurl to allow you to have more array entries?
There aren't any specifications as to how much ram each roku device ships with, how fast the processor is, etc etc, so for now I have the following questions:
When downloading an XML, what is the size of the storage area for the source file? ie - if I download a 3MB XML to parse, or pick and choose what data to add to an array, what would be the file size limit to hold the source xml?
Does all the XML need to exist before the screen is displayed, or can I have it load the episode xml based on which category is selected?
Most of the examples use static data - is there a better dynamic example available anywhere besides deviantart and/or the video player?
Does the size of a url matter in a content list as far as memory goes? - ie is there any ram benefit to using a url shortening service like tinyurl to allow you to have more array entries?
jbrave
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2011
12:29 PM
Re: Parse XML in chunks?
Generally, one would get the XML from a server that has URL based controls on the amount of data returned. For instance, I request data for my channels in chunks of 20 records so there is never a problem.
Http://API.company.com/files.XML?limit=20&page=0
Which should give a list of 20 files. To get the next 20, page=1
So if you are generating XML, make sure you have a control like that set up. If you are just serving XML as a file, then break it up into many files like 1.XML, 2.XML, 3.XML etc.
-Joel
Http://API.company.com/files.XML?limit=20&page=0
Which should give a list of 20 files. To get the next 20, page=1
So if you are generating XML, make sure you have a control like that set up. If you are just serving XML as a file, then break it up into many files like 1.XML, 2.XML, 3.XML etc.
-Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2011
08:26 PM
Re: Parse XML in chunks?
Thanks. 🙂