Fiet v0.1.0-rc1 Fiet.RSS2 behaviour View Source

A module to be used to implement RSS 2.0 parser.

Examples

A RSS 2.0 compliant parser can be implemented with:

defmodule StandardParser do
  use Fiet.RSS2
end

Parsers can also be customized by using :extras option, with :channel being all the outstanding tags in <channel> and :item being all the outstanding tags in <item> in the feed.

defmodule NotSoStardardParser do
  use Fiet.RSS2, [extras: [
    channel: [{"atom:link", "atom:link"}],
    item: [{"content:encoded", "encoded_content"}]
  ]]
end

Link to this section Summary

Callbacks

Parses RSS 2.0 document

Link to this section Types

Link to this type t() View Source
t() :: %Fiet.RSS2{channel: Fiet.RSS2.Channel.t()}

Link to this section Callbacks

Link to this callback parse(document) View Source
parse(document :: binary()) :: {:ok, Fiet.RSS2.t()} | {:error, any()}

Parses RSS 2.0 document.

This function accepts RSS 2.0 document in raw binary and returns {:ok, Fiet.RSS2.t()}, {:error, any} otherwise.