mmcdole / gofeed

Parse RSS, Atom and JSON feeds in Go
MIT License
2.6k stars 208 forks source link

The RSS 2.0 comments fields appears to be missing #214

Closed sthomen closed 1 year ago

sthomen commented 1 year ago

Expected behavior

I expected the RSS 2.0 comments field to appear somewhere

Actual behavior

I couldn't find the comments link anywhere.

It appears the RSS parser parses the comments tag but it then doesn't get included anywhere by the DefaultRSSTranslator.

mmcdole commented 1 year ago

@sthomen when parsing a feed, you have two options:

  1. You can use the universal gofeed parser, that will translate RSS, Atom, JSON feeds all into a unified type.
  2. You can use the feed-type specific parsers directly, like the rss.Parser, or atom.Parser

The feed-specific parsers include all spec-compliant fields for that that type. The universal gofeed parser isn't intended to be a superset of all the fields of the underlying parsers, but instead, something that is roughly the common denominator of them. There are lesser used fields in the individual parsers that didn't make the cut for the Gofeed parser struct.

So, if you want the RSS comments field, in this case, I'd use the latter rss.Parser directly, to gain access to Comment field value.