Fiet v0.3.0 Fiet View Source
Fiet is a feed parser which aims to provide extensibility, speed, and standard compliance.
Currently Fiet supports RSS 2.0 and Atom.
Feed format detecting
There are two main functions in this module: parse/1
and parse!/1
, which
provide detecting parsing. That means that it will detect the format of the
XML document input then parse and map it into Fiet.Feed
, which is the
unified format of all the feed formats supported by Fiet.
Please note that detecting logic works by checking the root tag of the XML document, it does not mean to validate the XML document.
Detecting overhead
If you know exactly the feed format of the XML document you are going to parse,
you are recommended to use Fiet.Atom
or Fiet.RSS2
to avoid overhead. That
will give you the full data parsed from the feed document.
Link to this section Summary
Link to this section Functions
Specs
parse(data :: binary()) :: {:ok, feed :: Fiet.Feed.t()} | {:error, reason :: any()}
Parse RSS document into a feed.
Example
rss = File.read!("/path/to/rss")
{:ok, %Fiet.Feed{} = feed} = Fiet.parse(rss)
Specs
parse!(data :: binary()) :: Fiet.Feed.t()
Same as parse/1
, but this will raise when error happen.
Example
rss = File.read!("/path/to/rss")
%Fiet.Feed{} = Fiet.parse(rss)