Streamex v0.3.0 Streamex.Feed
The Streamex.Feed module defines functions
for working with feed followers.
Summary
Functions
Make source feed follow target feed.
Returns {:ok, nil}, or {:error, message} if something went wrong
Make multiple sources follow multiple targets.
Accepts a list of {source, target} feeds.
Returns {:ok, nil}, or {:error, message} if something went wrong
Lists the given feed’s followers.
Returns {:ok, followers}, or {:error, message} if something went wrong
Lists the feeds the given feed is following.
Returns {:ok, following}, or {:error, message} if something went wrong
Initializes a new feed.
Both slug and user_id must contain only alphanumeric characters.
Returns {:ok, feed}, or {:error, message} if feed is invalid
Stop source feed from following target feed.
Returns {:ok, nil}, or {:error, message} if something went wrong
Types
t :: %Streamex.Feed{id: term, slug: term, user_id: term}
Functions
Make source feed follow target feed.
Returns {:ok, nil}, or {:error, message} if something went wrong.
Available options are:
activity_copy_limit- how many activities should be copied from the target feed. Defaults to300
Examples
iex> {_, source} = Streamex.Feed.new("user", "eric")
{:ok, %Streamex.Feed{...}}
iex> {_, target} = Streamex.Feed.new("user", "jessica")
{:ok, %Streamex.Feed{...}}
iex> Feed.follow(source, target)
{:ok, nil}
Make multiple sources follow multiple targets.
Accepts a list of {source, target} feeds.
Returns {:ok, nil}, or {:error, message} if something went wrong.
Available options are:
activity_copy_limit- how many activities should be copied from the target feed. Defaults to100
Examples
iex> {_, source} = Streamex.Feed.new("user", "eric")
{:ok, %Streamex.Feed{...}}
iex> {_, target} = Streamex.Feed.new("user", "jessica")
{:ok, %Streamex.Feed{...}}
iex> Feed.follow_many([{source, target}, ...])
{:ok, nil}
Lists the given feed’s followers.
Returns {:ok, followers}, or {:error, message} if something went wrong.
Available options are:
limit- limits the number of results. Defaults to25offset- offsets the results. The maximum amount is400
Examples
iex> Feed.followers(feed)
{:ok, [%Streamex.Follow{}...]}
Lists the feeds the given feed is following.
Returns {:ok, following}, or {:error, message} if something went wrong.
Available options are:
limit- limits the number of results. Defaults to25offset- offsets the results. The maximum amount is400filter- list of comma separated feed ids to filter on
Examples
iex> Feed.following(feed)
{:ok, [%Streamex.Follow{}...]}
Initializes a new feed.
Both slug and user_id must contain only alphanumeric characters.
Returns {:ok, feed}, or {:error, message} if feed is invalid.
Examples
iex > Streamex.Feed.new("user", "eric")
{:ok, %Streamex.Feed{...}}
iex > Streamex.Feed.new("user_", "eric")
{:error, "..."}
Stop source feed from following target feed.
Returns {:ok, nil}, or {:error, message} if something went wrong.
Available options are:
keep_history- iftrueactivities fromtargetwon’t be removed fromsource
Examples
iex> {_, source} = Streamex.Feed.new("user", "eric")
{:ok, %Streamex.Feed{...}}
iex> {_, target} = Streamex.Feed.new("user", "jessica")
{:ok, %Streamex.Feed{...}}
iex> Feed.unfollow(source, target)
{:ok, nil}