This PR got a bit chubby, so here’s a brief breakdown:
PollFeedJobshould correctly parse ATOM feeds
#5199 adds the integration tests for parsing and creating topics from RSS feed, this adds the tests for ATOM feed
TL;DR this provides a consistent interface for accessing the content of a feed item element.
Say we have a
atom_entry, both parsed by the built-in Ruby RSS module. The interface for accessing the
titleare quite different:
FeedItemAccessoracts as a general wrapper that provides a consistent interface:
accessor.element_content(:title)will extract the content of the
titleelement, and thus saves the pain from dealing with two different type of feed elements.
It ‘installs’ new elements so that
RSS::Parserwill accept and parses non-standard RSS/ATOM elements. EDIT: See https://github.com/discourse/discourse/pull/5311#issuecomment-345152707.
SimpleRSSwith Ruby RSS module
Having the aforementioned points already in-place, this is actually the easier part.
Open to suggestions Cheers