Bitnock / BNRSSFeedParser

Simple RSS and podcast parsing in Objective-C
https://github.com/Bitnock/BNRSSFeedParser
MIT License
22 stars 3 forks source link

Allow parse feed cached in disk (file path) #4

Closed torcelly closed 9 years ago

torcelly commented 9 years ago

Sometimes is useful cache the feed XML. The methods added allow parse feeds stored in disk (cached).

farski commented 9 years ago

I've never actually tried, does parseFeedURL: not work with file URLs for some reason?

torcelly commented 9 years ago

I tried

NSString *path = ...
NSURL *url = [NSURL fileURLWithPath:path]

and then parseFeedURL: but it doesn't work. :(

farski commented 9 years ago

If this is iOS you'd probably need to do something like

[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"fileName" ofType:@"html"]]
torcelly commented 9 years ago

If the feed xml is downloaded and cached, it is not a resource in main bundle. It's a file stored in "cache" folder in app sandbox. So I can't get it calling NSBundle.

farski commented 9 years ago

Ok let me take a look, I feel like NSURLRequest should be able to handle file URLs, so I'm not sure what's up.

farski commented 9 years ago

This should work if you're getting the URL from an NSFileManager using something like URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask. If you can't get that to work let me know. Also this PR seems to make a lot of unnecessary changes to the repository, so I'm going to close it for now. If you think the feature is still worthwhile please clean up the PR and open it back up.