Feedistiller.Feeder

Elixir encapsulation over the feeder module, allowing full usage of the stream API. This is a very straightforward encapsulation with direct mapping to feeder functions and minimal sugar over feeder records to map them to structs.

Summary

Functions

Parse a file. Mapping to :feeder.file/2 with default options

Parse a file. Mapping to :feeder.file/2

Parse some data

Parse a file. Mapping to :feeder.stream/2

Types

wd :: Timex.DateTime.t | nil
wl :: integer | nil
ws :: String.t | nil

Functions

file(filename)

Specs

file(String.t) ::
  {:ok, Feedistiller.Feeder.Channel.t, String.t} |
  {term, term, term, term, Feedistiller.Feeder.Channel.t}

Parse a file. Mapping to :feeder.file/2 with default options.

See xml_sax_parser documentation for full result type (in case of error, an incomplete Channel is returned as the last item of the error tuple).

file(filename, opts)

Specs

file(String.t, list) ::
  {:ok, term, String.t} |
  {term, term, term, term, term}

Parse a file. Mapping to :feeder.file/2.

See xml_sax_parser documentation for full result type (in case of error, an incomplete accumulator is returned as the last item of the error tuple).

stream(arg1)

Specs

Parse some data.

If the input parameter is a string, it will map to :feeder.stream/2 with default options. If itś a prop list, it will map to :feeder.stream/2 after calling your continuation function once to bootstrap the data (curiously xml_sax_parser does not do that automatically).

See xml_sax_parser documentation for full result type (in case of error, an incomplete Channel is returned as the last item of the error tuple).

stream(data, opts)

Specs

stream(String.t, Keyword.t) ::
  {:ok, term, String.t} |
  {term, term, term, term, term}

Parse a file. Mapping to :feeder.stream/2.

See xml_sax_parser documentation for full result type (in case of error, an incomplete accumulator is returned as the last item of the error tuple).