rasstaggregator v1.0.0-beta1 RaSStaggregator
The RSS aggregator for Elixir.
The RaSStaggregator will read the list of feeds from the configuration value:
config :rasstaggregator, feeds: [
%RaSStaggregator.Feed{id: :example_feed, url: "http://example.com/feed"},
%RaSStaggregator.Feed{id: :another_feed, url: "http://example.com/another_feed"},
%RaSStaggregator.Feed{id: :yet_another_feed, url: "http://example.com/yet_another_feed"},
]
It is also possible to add a feed programatically:
RaSStaggregator.add_feed(id, url)
RaSStaggregator will start a parser for each feed and periodically check them and store them into ETS. It is easy to get the list of feed entries from it:
feed = %RaSStaggregator.Feed{:id :example_feed, url: "http://example.com/feed"}
entries = RaSStaggregator.Cache.find(feed.id)
Summary
Functions
Adds a feed to the RaSStaggregator app
Returns the aggregator timeline consisting of the given feeds in a descending order
RaSStaggregator application start function
Functions
Adds a feed to the RaSStaggregator app.
Parameters
id
- Feed identifier.url
- Feed url.
Examples
iex> {:ok, pid} = RaSStaggregator.add_feed :example_feed, "http://example.com/feed"
iex> is_pid(pid)
true
get_timeline([atom]) :: [%FeederEx.Entry{author: term, duration: term, enclosure: term, id: term, image: term, link: term, subtitle: term, summary: term, title: term, updated: term}]
Returns the aggregator timeline consisting of the given feeds in a descending order.
Parameters
feeds
- List feed IDs to be includded in the timeline.
Examples
iex> RaSStaggregator.Cache.save(:first, [%FeederEx.Entry{title: “Example post 1”, updated: “Thu, 27 Apr 2017 10:00:00 +0200”}]) iex> RaSStaggregator.Cache.save(:second, [%FeederEx.Entry{title: “Example post 2”, updated: “Thu, 27 Apr 2017 12:00:00 +0200”}]) iex> RaSStaggregator.get_timeline [:first, :second] [%FeederEx.Entry{author: nil, duration: nil, enclosure: nil, id: nil, image: nil, link: nil, subtitle: nil, summary: nil, title: “Example post 2”, updated: “Thu, 27 Apr 2017 12:00:00 +0200”}, %FeederEx.Entry{author: nil, duration: nil, enclosure: nil, id: nil, image: nil, link: nil, subtitle: nil, summary: nil, title: “Example post 1”, updated: “Thu, 27 Apr 2017 10:00:00 +0200”}] iex> RaSStaggregator.get_timeline [:second] [%FeederEx.Entry{author: nil, duration: nil, enclosure: nil, id: nil, image: nil, link: nil, subtitle: nil, summary: nil, title: “Example post 2”, updated: “Thu, 27 Apr 2017 12:00:00 +0200”}] iex> RaSStaggregator.get_timeline [:first] [%FeederEx.Entry{author: nil, duration: nil, enclosure: nil, id: nil, image: nil, link: nil, subtitle: nil, summary: nil, title: “Example post 1”, updated: “Thu, 27 Apr 2017 10:00:00 +0200”}]