View Source Tw.V1_1.CursoredResult (Tw v0.1.1)
See the Twitter API documentation for details.
Link to this section Summary
Link to this section Types
Specs
cursor() :: integer()
Specs
Link to this section Functions
Specs
Return if there is a next page from a cursor.
Examples
iex> {:ok, res} = Tw.V1_1.User.follower_ids(client)
iex> Tw.V1_1.CursoredResult.has_next?(res)
true
Specs
Return if there is a previous page from a cursor.
Examples
iex> {:ok, res} = Tw.V1_1.User.follower_ids(client)
iex> Tw.V1_1.CursoredResult.has_previous?(res)
false
Specs
persevering_stream!( atom(), (integer() -> {:ok, map()} | {:error, Exception.t()}), integer() ) :: Enumerable.t()
Return cursored endpoints results as Stream
.
If the rate limit is exceeded, sleep and retry.
Examples
iex> Tw.V1_1.CursoredResult.persevering_stream!(:ids, fn cursor -> Tw.V1_1.User.fllower_ids(client, %{screen_name: "twitterapi", cursor: cursor}) end)
...> |> Enum.each(&IO.inspect/1)
Specs
stream!( atom(), (integer() -> {:ok, map()} | {:error, Exception.t()}), integer() ) :: Enumerable.t()
Return cursored endpoints results as Stream
.
Examples
iex> Tw.V1_1.CursoredResult.stream!(:ids, fn cursor -> Tw.V1_1.User.fllower_ids(client, %{screen_name: "twitterapi", cursor: cursor} end)
...> |> Enum.each(&IO.inspect/1)
iex> Tw.V1_1.CursoredResult.stream!(:ids, fn cursor -> Tw.V1_1.User.fllower_ids(client, %{screen_name: "twitterapi", cursor: cursor} end)
...> |> Stream.run()
** (Tw.V1_1.CursoredResult.StreamError) Rate limit exceeded