sof / feed

Haskell package for handling various feed (RSS) formats.
Other
14 stars 30 forks source link

fails to find enclosures in feed http://redecentralize.org/podcast/feed.rss #5

Closed joeyh closed 11 years ago

joeyh commented 11 years ago

Similar to #3, getItemEnclosure fails on this feed.

This time around, it seems we have length="" breaking things. Feed creators sure seem to have lots of ways to break something so simple!

sof commented 11 years ago

"Breaking things" -- what behaviour are you expecting?

joeyh commented 11 years ago

sof wrote:

"Breaking things" -- what behaviour are you expecting?

The library is able to parse this rss feed, using eg parseFeedFromFile. However, getItemEnclosure returns Nothing for each of the feedItems, which is not ideal since each of the items does have an enclosure, although with a bogus size of "".

see shy jo

sof commented 11 years ago

The following works for me with HEAD,

foo$ readFile "ff.rss" >>= \ ls -> return $ any (not.isJust) $ map Text.Feed.Query.getItemEnclosure (Text.Feed.Query.feedItems $ fromJust $ Text.Feed.Import.parseFeedString ls)

joeyh commented 11 years ago

sof wrote:

The following works for me with HEAD,

foo$ readFile "ff.rss" >>= \ ls -> return $ any (not.isJust) $ map Text.Feed.Query.getItemEnclosure (Text.Feed.Query.feedItems $ fromJust $ Text.Feed.Import.parseFeedString ls)

Apologies, I'm a bit under the weather today and seem to have forgotten to cabal install after pulling current HEAD. It does work.

see shy jo

sof commented 11 years ago

That's good, mystery solved. If the 'length' attribute is provided, but it isn't liked by 'reads', it'll be (silently) mapped to Nothing.

It makes sense for the parsers for these different RSS formats be liberal & accepting. But, having them at least report warnings when feeds sidestep the expected attribute types, and engages in other non-conforming behaviour, would have been helpful here, I suppose. No immediate plans to work on this though.