twitter_stream v0.2.6 TwitterStream View Source

TwitterStream is a GenServer that can be invoked manually via start_link/1 or added as a child_spec/1 to a supervision tree.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Start a twitter stream process given Twitter Streaming API parameters and a process to sink tweets to.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Start a twitter stream process given Twitter Streaming API parameters and a process to sink tweets to.

Returns {:ok, pid}.

The available keyword list of options are:

Parameters to send to the Twitter Streaming API.

params: %{"track" => "developer", "language" => "en", "filter_level" => "low"}

Process to send all decoded tweets to.

sink: self()

GenServer registration name, optional and defaults to TwitterStream.

name: DeveloperTwitterStream

Examples

iex> opts = [params: %{"track" => "developer"}, sink: self()]
iex> {:ok, pid} = TwitterStream.start_link(opts)
iex> flush()
{:tweet,
  %{
    "text" => "...",
    ...
  }
}