Closed joeyh closed 11 years ago
"Breaking things" -- what behaviour are you expecting?
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
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)
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
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.
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!