hunter v0.3.0 Hunter

A Elixir client for Mastodon, a GNU Social compatible micro-blogging service

Summary

Functions

Retrieve account

Block a user

Retrieve user’s blocks

Retrieve a card associated with a status

Deletes all notifications from the Mastodon server for the authenticated user

Destroy status

Favorite a status

Fetch a user’s favourites

Follow a user

Follow a remote user

Retrieve a list of follow requests

Get a list of followers

Get a list of followed accounts

Retrieve statuses from a hashtag

Retrieve statuses from the home timeline

Retrieve instance information

Mute a user

Retrieve user’s mutes

Initializes a client

Retrieve single notification

Retrieve user’s notifications

Retrieve statuses from the public timeline

Reblog a status

Get the relationships of authenticated user towards given other users

Retrieve a user’s reports

Search for accounts

Retrieve status

Retrieve status context

Get a list of statuses by a user

Unblock a user

Undo a favorite of a status

Unfollow a user

Unmute a user

Undo a reblog of a status

Upload a media file

User agent of the client

Retrieve account of authenticated user

Returns Hunter version

Functions

account(conn, id)
account(Hunter.Client.t, non_neg_integer) :: Hunter.Account.t

Retrieve account

Parameters

  • conn - connection credentials
  • id - account identifier
block(conn, id)
block(Hunter.Client.t, non_neg_integer) :: Hunter.Relationship.t

Block a user

Parameters

  • conn - connection credentials
  • id - user identifier
blocks(conn)

Retrieve user’s blocks

Parameters

  • conn - connection credentials
card_by_status(conn, id)
card_by_status(Hunter.Client.t, non_neg_integer) :: Hunter.Card.t

Retrieve a card associated with a status

Parameters

  • conn - connection credentials
  • id - status id
clear_notifications(conn)
clear_notifications(Hunter.Client.t) :: map

Deletes all notifications from the Mastodon server for the authenticated user

Parameters

  • conn - connection credentials
create_app(name, redirect_uri \\ "urn:ietf:wg:oauth:2.0:oob", scopes \\ "read", website \\ nil)

Register a new OAuth client app on the target instance

Parameters

  • conn - connection credentials
  • name - name of your application
  • redirect_uri - where the user should be redirected after authorization, default: urn:ietf:wg:oauth:2.0:oob (no redirect)
  • scopes - scope list, see the scope section for more details, default: read
  • website - URL to the homepage of your app, default: nil

Scopes

  • read - read data
  • write - post statuses and upload media for statuses
  • follow - follow, unfollow, block, unblock

Multiple scopes can be requested during the authorization phase with the scope query param

create_status(conn, text, in_reply_to_id \\ nil, media_ids \\ [])
create_status(Hunter.Client.t, String.t, non_neg_integer, [non_neg_integer]) :: Hunter.Status.t

Create new status

Parameters

  • conn - connection credentials
  • text - [String]
  • in_reply_to_id - [Integer]
  • media_ids - [Array]
destroy_status(conn, id)
destroy_status(Hunter.Client.t, non_neg_integer) :: boolean

Destroy status

Parameters

  • conn - connection credentials
  • id - status identifier
favourite(conn, id)
favourite(Hunter.Client.t, non_neg_integer) :: Hunter.Status.t

Favorite a status

Parameters

  • conn - connection credentials
  • id - status identifier
favourites(conn)
favourites(Hunter.Client.t) :: [Hunter.Status.t]

Fetch a user’s favourites

Parameters

  • conn - connection credentials
follow(conn, id)
follow(Hunter.Client.t, non_neg_integer) :: Hunter.Relationship.t

Follow a user

Parameters

  • conn - connection credentials
  • id - user identifier
follow_by_uri(conn, uri)

Follow a remote user

Parameters

  • conn - connection credentials
  • uri - URI of the remote user, in the format of username@domain
follow_requests(conn)
follow_requests(Hunter.Client.t) :: [Hunter.Account.t]

Retrieve a list of follow requests

Parameters

  • conn - connection credentials
followers(conn, id)
followers(Hunter.Client.t, non_neg_integer) :: [Hunter.Account.t]

Get a list of followers

Parameters

  • conn - connection credentials
  • id - account identifier
following(conn, id)
following(Hunter.Client.t, non_neg_integer) :: [Hunter.Account.t]

Get a list of followed accounts

Parameters

  • conn - connection credentials
  • id - account identifier
hashtag_timeline(conn, hashtag, options \\ [])
hashtag_timeline(Hunter.Client.t, [String.t], Keyword.t) :: [Hunter.Status.t]

Retrieve statuses from a hashtag

Parameters

  • conn - connection credentials
  • hashtag - string list

Options

  • max_id - [Integer]
  • since_id - [Integer]
  • limit - [Integer]
home_timeline(conn, options \\ [])

Retrieve statuses from the home timeline

Parameters

  • conn - connection credentials
  • options - option list

Options

  • max_id - [Integer]
  • since_id - [Integer]
  • limit - [Integer]
instance_info(conn)

Retrieve instance information

Parameters

  • conn - connection credentials
mute(conn, id)
mute(Hunter.Client.t, non_neg_integer) :: Hunter.Relationship.t

Mute a user

Parameters

  • conn - connection credentials
  • id - user identifier
mutes(conn)

Retrieve user’s mutes

Parameters

  • conn - connection credentials
new(options \\ [])

Initializes a client

Options

  • base_url - URL of the instance you want to connect to
  • bearer_token - [String] OAuth access token for your authenticated user
notification(conn, id)
notification(Hunter.Client.t, non_neg_integer) :: Hunter.Notification.t

Retrieve single notification

Parameters

  • conn - connection credentials
  • id - notification identifier
notifications(conn)

Retrieve user’s notifications

Parameters

  • conn - connection credentials
public_timeline(conn, options \\ [])
public_timeline(Hunter.Client.t, Keyword.t) :: [Hunter.Status.t]

Retrieve statuses from the public timeline

Parameters

  • conn - connection credentials
  • options - option list

Options

  • max_id - [Integer]
  • since_id - [Integer]
  • limit - [Integer]
reblog(conn, id)
reblog(Hunter.Client.t, non_neg_integer) :: Hunter.Status.t

Reblog a status

Parameters

  • conn - connection credentials
  • id - status identifier
relationships(conn, ids)
relationships(Hunter.Client.t, [non_neg_integer]) :: [Hunter.Relationship.t]

Get the relationships of authenticated user towards given other users

Parameters

  • conn - connection credentials
  • id - list of relationship IDs
report(conn, account_id, status_ids, comment)
report(Hunter.Client.t, non_neg_integer, [non_neg_integer], String.t) :: Hunter.Report.t

Report a user

Parameters

  • conn - connection credentials
  • account_id - the ID of the account to report
  • status_ids - the IDs of statuses to report
  • comment - a comment to associate with the report
reports(conn)

Retrieve a user’s reports

Parameters

  • conn - connection credentials
search(conn, query, options \\ [])

Search for content

Parameters

  • conn - connection credentials
  • q - the search query
  • options - option list

Options

  • resolve - whether to resolve non-local accounts
search_account(conn, options)

Search for accounts

Parameters

  • conn - connection credentials
  • options - option list

Options

  • q: what to search for
  • limit: maximum number of matching accounts to return, default: 40
status(conn, id)
status(Hunter.Client.t, non_neg_integer) :: Hunter.Status.t

Retrieve status

Parameters

  • conn - connection credentials
  • id - status identifier
status_context(conn, id)
status_context(Hunter.Client.t, non_neg_integer) :: Hunter.Context.t

Retrieve status context

Parameters

  • conn - connection credentials
  • id - status identifier
statuses(conn, account_id, options \\ [])
statuses(Hunter.Client.t, non_neg_integer, Keyword.t) :: [Hunter.Status.t]

Get a list of statuses by a user

Parameters

  • conn - connection credentials -
  • account_id - account identifier
  • options - option list

Options

  • max_id - [Integer]
  • since_id - [Integer]
  • limit - [Integer]
unblock(conn, id)
unblock(Hunter.Client.t, non_neg_integer) :: Hunter.Relationship.t

Unblock a user

  • conn - connection credentials
  • id - user identifier
unfavourite(conn, id)
unfavourite(Hunter.Client.t, non_neg_integer) :: Hunter.Status.t

Undo a favorite of a status

Parameters

  • conn - connection credentials
  • id - status identifier
unfollow(conn, id)
unfollow(Hunter.Client.t, non_neg_integer) :: Hunter.Relationship.t

Unfollow a user

Parameters

  • conn - connection credentials
  • id - user identifier
unmute(conn, id)
unmute(Hunter.Client.t, non_neg_integer) :: Hunter.Relationship.t

Unmute a user

Parameters

  • conn - connection credentials
  • id - user identifier
unreblog(conn, id)
unreblog(Hunter.Client.t, non_neg_integer) :: Hunter.Status.t

Undo a reblog of a status

Parameters

  • conn - connection credentials
  • id - status identifier
upload_media(conn, file)

Upload a media file

Parameters

  • conn - connection credentials
  • file - media to be uploaded
user_agent()
user_agent() :: String.t

User agent of the client

verify_credentials(conn)
verify_credentials(Hunter.Client.t) :: Hunter.Account.t

Retrieve account of authenticated user

Parameters

  • conn - connection credentials
version()
version() :: String.t

Returns Hunter version