views:

94

answers:

1

Hi,

I'm playing with some javascript for iPhone using Titanium Mobile. Being a newbie to JS, the challenge I'm at at the moment is pointing my app to a URL and converting/stripping the resultant full blown web page down to something that's iPhone friendly i.e. strip out page header images, other JS etc etc and just be left with the content text and scaled down images.

Is there any sample code / suggestions / plugins that would allow me to do this without (in my case) weeks and weeks of coding and sweat? :)

Any help would be fantastic indeed. Thanks Martin

A: 

This is a non-trivial problem, since there's no set definition of what a "page header" is. However, take a look at Readability. It is a javascript bookmarklet that attempts to strip out anything that is not the main page text.

Max Shawabkeh
thanks so much Max for your reply. I'll check it out
MartinC
Did I say I was a JS newbie? Oh yeah, I did :)I'm really stumbling on JS syntax at the moment, it seems. I'm able to get the destination URL via JS code which is extracted from the RSS feed.I've had a look at the readability.js files from http://code.google.com/p/arc90labs-readability/ however it looks like it's essentially set up to be applied to an already loaded document as opposed to working on array-loaded data (hopefully used correct terms there).Anyone got any clues on how to load a webpage into an array and access/use readability on that array and then display it?
MartinC
OH and readability works great on the webpage too so if I'm able to do the above, issue solved
MartinC