feedparser icon indicating copy to clipboard operation
feedparser copied to clipboard

Support channel image

Open onli opened this issue 6 years ago • 3 comments

RSS and Atom both support setting a channel image, with the three nodes url, title and link. See https://cyber.harvard.edu/rss/rss.html#ltimagegtSubelementOfLtchannelgt for the RSS side, and https://tools.ietf.org/html/rfc4287#section-4.2.8 for the Atom side (I think that's the best fit, but it seems to support just an URL). Maybe feedparser could be extended to carry the channel image around?

onli avatar Mar 03 '19 23:03 onli

One idea is to easily support access to the full underlying structure with all its additions (in a uniform "parsed" way e.g. xml or json converted to a nested ruby hash, for example.

Also might be a good idea to check what feedjira https://github.com/feedjira/feedjira offers or how it handles channel images?

geraldb avatar Mar 06 '19 19:03 geraldb

feedjira has a class for rss channel images in https://github.com/feedjira/feedjira/blob/master/lib/feedjira/parser/rss_image.rb/. I think it has no equivalents for atom and jsonfeed.

Having full access to the origin structure sounds very useful. Something like https://stackoverflow.com/a/10144623/2508518 could work, though I assume nokogiri is not an ideal requirement for this gem.

onli avatar Mar 06 '19 19:03 onli

Thanks. Good points. Soon or later the "old" standard rss library has to get replaced with something better. Why not nokogiri? I'm all for it. The only downside as far as I can tell is the "hard-to-install" part because it requires a c-extension. The idea of the nested hash is that it is uniform, that is, the same for xml and json - thus, I'm not sure if the nokogiri .to_hash format (or is it just a "dump") is a 100% fit here. But yeah it's the same basic idea.

geraldb avatar Mar 06 '19 19:03 geraldb