nmdias / FeedKit

An RSS, Atom and JSON Feed parser written in Swift
MIT License
1.19k stars 174 forks source link

Support for RSS 1.0 #9

Closed mehlkelm closed 7 years ago

mehlkelm commented 7 years ago

The way I read the README, FeedKit claims to support older RSS versions. It detects RSS 1.0 correctly based on the rdf:RDF tag. The RSSPath class however doesn't handle paths like "/rdf:RDF/channel/title". No information for the following feed can be parsed, for example: http://rss.slashdot.org/Slashdot/slashdotMain

mehlkelm commented 7 years ago

I tried a quick fix/workaround by adding an initializer to RSSPath which re-maps some of the differences: init?(rssPath: String) { var RSS2mappedPath = rssPath.replacingOccurrences(of: "/rdf:RDF/item", with: "/rss/channel/item") RSS2mappedPath = RSS2mappedPath.replacingOccurrences(of:"/rdf:RDF", with:"/rss") self.init(rawValue: RSS2mappedPath) } But there are too many item properties packed into XML attributes instead of XML elements for that… I guess we would need a whole new set of mapping classes for RSS 1.0.

aehlke commented 7 years ago

I'm evaluating https://github.com/younata/Muon which claims to support RSS 1.0

edit: It worked for me, but I only tested limited RSS 1.0 capabilities.

nmdias commented 7 years ago

Well, this took a while... FeedKit 6.2.0 is out in the wild.