I’m writing just another feed reader and I want to make it easy to add new feeds, so I implement a UIWebView where you can browse the web and when you hit the Add button the current page should be scanned for rss feed URLs. But I don’t get it.
I have no real idea about Javascript and DOM.
But I know you can get the content of a UIWebview with [wv stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];.
So I tried @"document.head" but that doesn’t work.
Is there a way to get the <head> of the currently displayed webpage with the help of some javascript?
Or even better, can I use javascript to get the actual feed urls?
I want to avoid to do another fetch on the url to get the html and then scan for the feed urls with NSScanner.
I’m looking forward to pushes into the right direction.
instead use “document.all[0].innerHTML”. I am sure this will get you complete HTML source of your current web-page, and not just the content between body element. Then try scanning for element.