An Elixir client for the Mastodon API
Summary
Functions
Accepts a follow request
Accept a notification request
Accept multiple notification requests
Retrieve account
Retrieve the user's lists that contain a given account
Add accounts to a list; the user must be following each of them
Block a user
Block a domain
Fetch user's blocked domains
Retrieve user's blocks
Bookmark a status
Fetch the user's bookmarked statuses
Dismiss a single notification
Deletes all notifications from the Mastodon server for the authenticated user
Register a new OAuth client app on the target instance
Create a new list
Subscribe to Web Push notifications; each access token can have exactly one subscription, and creating a new one replaces it
Create new status
Delete a media attachment that is not currently attached to a status
Remove the Web Push subscription tied to the access token
Delete a list
Destroy status
Dismiss a notification group
Dismiss a notification request
Dismiss multiple notification requests
Edit a status
Favorite a status
Fetch the list of users who favourited the status
Fetch a user's favourites
Follow a user
Retrieve a list of follow requests
Get a list of followers
Get a list of followed accounts
Retrieve grouped notifications, together with the accounts and statuses they reference
Retrieve the number of unread notification groups, capped by the server
Retrieve statuses from a hashtag
Retrieve statuses from the home timeline
Retrieve instance information
Retrieve a list
Retrieve the accounts in a list
Retrieve statuses from the given list's timeline
Retrieve all lists the user owns
Load persisted application's credentials
Retrieve access token
Retrieve access token via OAuth
Retrieve a media attachment, to check the processing status of an asynchronous upload
Mute a user
Mute a conversation, so its thread stops generating notifications
Retrieve user's mutes
Initializes a client
Retrieve single notification
Retrieve a single notification group by its group key
Retrieve the accounts of all notifications in a notification group
Retrieve the notification filtering policy for the user
Retrieve a single notification request
Retrieve notification requests (groups of filtered notifications)
Check whether accepted notification requests have been merged
Retrieve user's notifications
Pin a status to the top of the user's profile
Retrieve a poll
Retrieve statuses from the public timeline
Retrieve the Web Push subscription tied to the access token
Reblog a status
Fetch the list of users who reblogged the status.
Rejects a follow request
Get the relationships of authenticated user towards given other users
Remove accounts from a list
Report a user
Search for content
Search for accounts
Retrieve status
Retrieve status context
Retrieve the edit history of a status
Retrieve the plain-text source of a status, for editing
Get a list of statuses by a user
Retrieve multiple statuses by id
Translate a status into some language
Unblock a user
Unblock a domain
Remove a status from bookmarks
Undo a favorite of a status
Unfollow a user
Unmute a user
Unmute a conversation
Unpin a status from the user's profile
Retrieve the number of unread notifications, capped by the server
Undo a reblog of a status
Make changes to the authenticated user
Update a list
Update a media attachment, before it is attached to a status
Update the notification filtering policy for the user
Update the data portion of the Web Push subscription
Upload a media file
User agent of the client
Retrieve account of authenticated user
Returns Hunter version
Vote on one or more options in a poll
Functions
@spec accept_follow_request(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Accepts a follow request
Parameters
conn- connection credentialsid- follow request id
@spec accept_notification_request(Hunter.Client.t(), String.t() | non_neg_integer()) :: boolean()
Accept a notification request
Parameters
conn- connection credentialsid- notification request identifier
@spec accept_notification_requests(Hunter.Client.t(), [String.t() | non_neg_integer()]) :: boolean()
Accept multiple notification requests
Parameters
conn- connection credentialsids- notification request identifiers
@spec account(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Account.t()
Retrieve account
Parameters
conn- connection credentialsid- account identifier
@spec account_lists(Hunter.Client.t(), String.t() | non_neg_integer()) :: [ Hunter.List.t() ]
Retrieve the user's lists that contain a given account
Parameters
conn- connection credentialsaccount_id- account identifier
@spec add_accounts_to_list(Hunter.Client.t(), String.t() | non_neg_integer(), [ String.t() | non_neg_integer() ]) :: boolean()
Add accounts to a list; the user must be following each of them
Parameters
conn- connection credentialsid- list identifieraccount_ids- account identifiers to add
@spec block(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Block a user
Parameters
conn- connection credentialsid- user identifier
@spec block_domain(Hunter.Client.t(), String.t()) :: boolean()
Block a domain
Parameters
conn- connection credentialsdomain- domain to block
@spec blocked_domains(Hunter.Client.t(), Keyword.t()) :: list()
Fetch user's blocked domains
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of blocks with id less than or equal this valuesince_id- get a list of blocks with id greater than this valuelimit- maximum number of blocks to get, default: 40, max: 80
@spec blocks(Hunter.Client.t(), Keyword.t()) :: [Hunter.Account.t()]
Retrieve user's blocks
Parameters
conn- connection credentials
Options
max_id- get a list of blocks with id less than or equal this valuesince_id- get a list of blocks with id greater than this valuelimit- maximum number of blocks to get, default: 40, max: 80
@spec bookmark(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Bookmark a status
Parameters
conn- connection credentialsid- status identifier
@spec bookmarks(Hunter.Client.t(), Keyword.t()) :: [Hunter.Status.t()]
Fetch the user's bookmarked statuses
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of bookmarks with id less than or equal this valuesince_id- get a list of bookmarks with id greater than this valuemin_id- get a list of bookmarks with id greater than this value, immediately newerlimit- maximum number of bookmarks to get, default: 20, max: 40
@spec clear_notification(Hunter.Client.t(), String.t() | non_neg_integer()) :: boolean()
Dismiss a single notification
Parameters
conn- connection credentialsid- notification id
@spec clear_notifications(Hunter.Client.t()) :: boolean()
Deletes all notifications from the Mastodon server for the authenticated user
Parameters
conn- connection credentials
@spec create_app(String.t(), String.t(), [String.t()], nil | String.t(), Keyword.t()) :: Hunter.Application.t() | no_return()
Register a new OAuth client app on the target instance
Parameters
name- name of your applicationredirect_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:readwebsite- URL to the homepage of your app, default:niloptions- option list
Scopes
read- read datawrite- post statuses and upload media for statusesfollow- follow, unfollow, block, unblock
Multiple scopes can be requested during the authorization phase with the scope query param
Options
save?- persists your application information to a file, so, you can use them later. default:falseapi_base_url- specifies if you want to register an application on a different instance. default:https://mastodon.social
Examples
iex> Hunter.create_app("hunter", "urn:ietf:wg:oauth:2.0:oob", ["read", "write", "follow"], nil, [save?: true, api_base_url: "https://example.com"])
%Hunter.Application{client_id: "1234567890",
client_secret: "1234567890",
id: "1234"}
@spec create_list(Hunter.Client.t(), String.t(), Keyword.t()) :: Hunter.List.t()
Create a new list
Parameters
conn- connection credentialstitle- the title of the listoptions- option list
Options
replies_policy- which replies should be shown in the list, one of:followed,list,none; default:listexclusive- whether members of the list are removed from the home timeline
@spec create_push_subscription(Hunter.Client.t(), map(), map()) :: Hunter.WebPushSubscription.t()
Subscribe to Web Push notifications; each access token can have exactly one subscription, and creating a new one replaces it
Parameters
conn- connection credentialssubscription- map withendpoint,keys(p256dhandauth) and optionallystandarddata- optional map withalertsandpolicy
@spec create_status(Hunter.Client.t(), String.t(), Keyword.t()) :: Hunter.Status.t() | Hunter.ScheduledStatus.t() | no_return()
Create new status
Parameters
conn- connection credentialsstatus- text of the statusoptions- option list
Options
in_reply_to_id- local ID of the status you want to reply tomedia_ids- list of media IDs to attach to the status (maximum: 4)sensitive- whether the media of the status is NSFWspoiler_text- text to be shown as a warning before the actual contentvisibility- eitherdirect,private,unlistedorpubliclanguage- ISO 639-1 language code for the statuspoll- map withoptions(list of choices) andexpires_in(seconds); optional:multiple,hide_totalsquoted_status_id- ID of a status to quotescheduled_at- ISO 8601 datetime (at least 5 minutes ahead) at which the status should be published; the call returns aHunter.ScheduledStatusinstead of aHunter.Statusidempotency_key- unique string sent as theIdempotency-Keyheader to prevent duplicate submissions
@spec delete_media(Hunter.Client.t(), String.t() | non_neg_integer()) :: boolean()
Delete a media attachment that is not currently attached to a status
Parameters
conn- connection credentialsid- attachment identifier
@spec delete_push_subscription(Hunter.Client.t()) :: boolean()
Remove the Web Push subscription tied to the access token
Parameters
conn- connection credentials
@spec destroy_list(Hunter.Client.t(), String.t() | non_neg_integer()) :: boolean()
Delete a list
Parameters
conn- connection credentialsid- list identifier
@spec destroy_status(Hunter.Client.t(), String.t() | non_neg_integer()) :: boolean()
Destroy status
Parameters
conn- connection credentialsid- status identifier
@spec dismiss_notification_group(Hunter.Client.t(), String.t()) :: boolean()
Dismiss a notification group
Parameters
conn- connection credentialsgroup_key- notification group key
@spec dismiss_notification_request(Hunter.Client.t(), String.t() | non_neg_integer()) :: boolean()
Dismiss a notification request
Parameters
conn- connection credentialsid- notification request identifier
@spec dismiss_notification_requests(Hunter.Client.t(), [ String.t() | non_neg_integer() ]) :: boolean()
Dismiss multiple notification requests
Parameters
conn- connection credentialsids- notification request identifiers
@spec edit_status( Hunter.Client.t(), String.t() | non_neg_integer(), String.t(), Keyword.t() ) :: Hunter.Status.t() | no_return()
Edit a status
Parameters
conn- connection credentialsid- status identifierstatus- the new text of the statusoptions- option list
Options
spoiler_text- text to be shown as a warning before the actual contentsensitive- whether the media of the status is NSFWlanguage- ISO 639-1 language code for the statusmedia_ids- list of media IDs to attach to the statuspoll- map withoptions(list of choices) andexpires_in(seconds); replaces the current poll
@spec favourite(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Favorite a status
Parameters
conn- connection credentialsid- status identifier
@spec favourited_by(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: [ Hunter.Account.t() ]
Fetch the list of users who favourited the status
Parameters
conn- connection credentialsid- status identifieroptions- option list
Options
max_id- get a list of favourited by ids less than or equal this valuesince_id- get a list of favourited by ids greater than this valuelimit- maximum number of favourited by to get, default: 40, max: 80
@spec favourites(Hunter.Client.t(), Keyword.t()) :: [Hunter.Status.t()]
Fetch a user's favourites
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of favourites with id less than or equal this valuesince_id- get a list of favourites with id greater than this valuelimit- maximum of favourites to get, default: 20, max: 40
@spec follow(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Follow a user
Parameters
conn- connection credentialsid- user identifier
@spec follow_requests(Hunter.Client.t(), Keyword.t()) :: [Hunter.Account.t()]
Retrieve a list of follow requests
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of follow requests with id less than or equal this valuesince_id- get a list of follow requests with id greater than this valuelimit- maximum number of requests to get, default: 40, max: 80
@spec followers(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: [ Hunter.Account.t() ]
Get a list of followers
Parameters
conn- connection credentialsid- account identifieroptions- options list
Options
max_id- get a list of followers with id less than or equal this valuesince_id- get a list of followers with id greater than this valuelimit- maximum number of followers to get, default: 40, maximum: 80
Note: max_id and since_id for next and previous pages are provided in
the Link header. It is not possible to use the id of the returned
objects to construct your own URLs, because the results are sorted by an
internal key.
@spec following(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: [ Hunter.Account.t() ]
Get a list of followed accounts
Parameters
conn- connection credentialsid- account identifieroptions- options list
Options
max_id- get a list of followings with id less than or equal this valuesince_id- get a list of followings with id greater than this valuelimit- maximum number of followings to get, default: 40, maximum: 80
Note: max_id and since_id for next and previous pages are provided in
the Link header. It is not possible to use the id of the returned
objects to construct your own URLs, because the results are sorted by an
internal key.
@spec grouped_notifications(Hunter.Client.t(), Keyword.t()) :: Hunter.GroupedNotificationsResults.t()
Retrieve grouped notifications, together with the accounts and statuses they reference
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get groups with id less than or equal this valuesince_id- get groups with id greater than this valuelimit- maximum number of groups to get, default: 40, max: 80types- notification types to includeexclude_types- notification types to excludegrouped_types- which types can be grouped together
@spec grouped_unread_count(Hunter.Client.t()) :: non_neg_integer()
Retrieve the number of unread notification groups, capped by the server
Parameters
conn- connection credentials
@spec hashtag_timeline(Hunter.Client.t(), [String.t()], Keyword.t()) :: [ Hunter.Status.t() ]
Retrieve statuses from a hashtag
Parameters
conn- connection credentialshashtag- string listoptions- option list
Options
local- only return statuses originating from this instancemax_id- get a list of timelines with id less than or equal this valuesince_id- get a list of timelines with id greater than this valuelimit- maximum number of statuses on the requested timeline to get, default: 20, max: 40
@spec home_timeline(Hunter.Client.t(), Keyword.t()) :: [Hunter.Status.t()]
Retrieve statuses from the home timeline
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of timelines with id less than or equal this valuesince_id- get a list of timelines with id greater than this valuelimit- maximum number of statuses on the requested timeline to get, default: 20, max: 40
@spec instance_info(Hunter.Client.t()) :: Hunter.Instance.t()
Retrieve instance information
Parameters
conn- connection credentials
Examples
iex> conn = Hunter.new([base_url: "https://social.lou.lt", access_token: "123456"])
%Hunter.Client{base_url: "https://social.lou.lt", access_token: "123456"}
iex> Hunter.instance_info(conn)
%Hunter.Instance{description: "Mostly French instance - <a href=\"/about/more#rules\">Read full description</a> for rules.",
domain: "social.lou.lt", title: "Loultstodon", version: "4.3.8"}
@spec list(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.List.t()
Retrieve a list
Parameters
conn- connection credentialsid- list identifier
@spec list_accounts(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: [ Hunter.Account.t() ]
Retrieve the accounts in a list
Parameters
conn- connection credentialsid- list identifieroptions- option list
Options
max_id- get a list of accounts with id less than or equal this valuesince_id- get a list of accounts with id greater than this valuelimit- maximum number of accounts to get, default: 40; set to 0 to get all accounts in the list
@spec list_timeline(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: [ Hunter.Status.t() ]
Retrieve statuses from the given list's timeline
Parameters
conn- connection credentialslist_id- list identifieroptions- option list
Options
max_id- get a list of timelines with id less than or equal this valuesince_id- get a list of timelines with id greater than this valuelimit- maximum number of statuses on the requested timeline to get, default: 20, max: 40
@spec lists(Hunter.Client.t()) :: [Hunter.List.t()]
Retrieve all lists the user owns
Parameters
conn- connection credentials
@spec load_credentials(String.t()) :: Hunter.Application.t()
Load persisted application's credentials
Parameters
name- application's name
@spec log_in(Hunter.Application.t(), String.t(), String.t(), String.t()) :: Hunter.Client.t()
Retrieve access token
Parameters
app- application details, see:Hunter.create_app/5for more details.username- account's emailpassword- account's passwordbase_url- API base url, default:https://mastodon.social
@spec log_in_oauth(Hunter.Application.t(), String.t(), String.t()) :: Hunter.Client.t()
Retrieve access token via OAuth
Parameters
app- application details, see:Hunter.create_app/5for more details.oauth_code- OAuth authentication codebase_url- API base url, default:https://mastodon.social
@spec media_attachment(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Attachment.t()
Retrieve a media attachment, to check the processing status of an asynchronous upload
Parameters
conn- connection credentialsid- attachment identifier
@spec mute(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Mute a user
Parameters
conn- connection credentialsid- user identifier
@spec mute_conversation(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Mute a conversation, so its thread stops generating notifications
Parameters
conn- connection credentialsid- status identifier
@spec mutes(Hunter.Client.t(), Keyword.t()) :: [Hunter.Account.t()]
Retrieve user's mutes
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of mutes with id less than or equal this valuesince_id- get a list of mutes with id greater than this valuelimit- maximum number of mutes to get, default: 40, max: 80
@spec new(Keyword.t()) :: Hunter.Client.t()
Initializes a client
Options
base_url- URL of the instance you want to connect toaccess_token- [String] OAuth access token for your authenticated user
@spec notification(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Notification.t()
Retrieve single notification
Parameters
conn- connection credentialsid- notification identifier
Examples
Hunter.notification(conn, 17_476)
#=> %Hunter.Notification{account: %{"acct" => "paperswelove@mstdn.io", ...}
@spec notification_group(Hunter.Client.t(), String.t()) :: Hunter.GroupedNotificationsResults.t()
Retrieve a single notification group by its group key
Parameters
conn- connection credentialsgroup_key- notification group key
@spec notification_group_accounts(Hunter.Client.t(), String.t()) :: [ Hunter.Account.t() ]
Retrieve the accounts of all notifications in a notification group
Parameters
conn- connection credentialsgroup_key- notification group key
@spec notification_policy(Hunter.Client.t()) :: Hunter.NotificationPolicy.t()
Retrieve the notification filtering policy for the user
Parameters
conn- connection credentials
@spec notification_request(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.NotificationRequest.t()
Retrieve a single notification request
Parameters
conn- connection credentialsid- notification request identifier
@spec notification_requests(Hunter.Client.t(), Keyword.t()) :: [ Hunter.NotificationRequest.t() ]
Retrieve notification requests (groups of filtered notifications)
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get requests with id less than or equal this valuesince_id- get requests with id greater than this valuelimit- maximum number of requests to get, default: 40, max: 80
@spec notification_requests_merged?(Hunter.Client.t()) :: boolean()
Check whether accepted notification requests have been merged
Parameters
conn- connection credentials
@spec notifications(Hunter.Client.t(), Keyword.t()) :: [Hunter.Notification.t()]
Retrieve user's notifications
Parameters
conn- connection credentialsoptions- option list
Options
max_id- get a list of notifications with id less than or equal this valuesince_id- get a list of notifications with id greater than this valuelimit- maximum number of notifications to get, default: 15, max: 30
Examples
Hunter.notifications(conn)
#=> [%Hunter.Notification{account: %{"acct" => "paperswelove@mstdn.io", ...}]
@spec pin(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Pin a status to the top of the user's profile
Parameters
conn- connection credentialsid- status identifier
@spec poll(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Poll.t()
Retrieve a poll
Parameters
conn- connection credentialsid- poll identifier
@spec public_timeline(Hunter.Client.t(), Keyword.t()) :: [Hunter.Status.t()]
Retrieve statuses from the public timeline
Parameters
conn- connection credentialsoptions- option list
Options
local- only return statuses originating from this instancemax_id- get a list of timelines with id less than or equal this valuesince_id- get a list of timelines with id greater than this valuelimit- maximum number of statuses on the requested timeline to get, default: 20, max: 40
@spec push_subscription(Hunter.Client.t()) :: Hunter.WebPushSubscription.t()
Retrieve the Web Push subscription tied to the access token
Parameters
conn- connection credentials
@spec reblog(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Reblog a status
Parameters
conn- connection credentialsid- status identifier
@spec reblogged_by(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: [ Hunter.Account.t() ]
Fetch the list of users who reblogged the status.
Parameters
conn- connection credentialsid- status identifieroptions- option list
Options
max_id- get a list of reblogged by ids less than or equal this valuesince_id- get a list of reblogged by ids greater than this valuelimit- maximum number of reblogged by to get, default: 40, max: 80
@spec reject_follow_request(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Rejects a follow request
Parameters
conn- connection credentialsid- follow request id
@spec relationships(Hunter.Client.t(), [String.t() | non_neg_integer()]) :: [ Hunter.Relationship.t() ]
Get the relationships of authenticated user towards given other users
Parameters
conn- connection credentialsid- list of relationship IDs
@spec remove_accounts_from_list(Hunter.Client.t(), String.t() | non_neg_integer(), [ String.t() | non_neg_integer() ]) :: boolean()
Remove accounts from a list
Parameters
conn- connection credentialsid- list identifieraccount_ids- account identifiers to remove
@spec report( Hunter.Client.t(), String.t() | non_neg_integer(), [String.t() | non_neg_integer()], String.t() ) :: Hunter.Report.t()
Report a user
Parameters
conn- connection credentialsaccount_id- the ID of the account to reportstatus_ids- the IDs of statuses to reportcomment- a comment to associate with the report
@spec search(Hunter.Client.t(), String.t(), Keyword.t()) :: Hunter.Result.t()
Search for content
Parameters
conn- connection credentialsq- the search queryoptions- option list
Options
resolve- whether to resolve non-local accounts
@spec search_account(Hunter.Client.t(), Keyword.t()) :: [Hunter.Account.t()]
Search for accounts
Parameters
conn- connection credentialsoptions- option list
Options
q: what to search forlimit: maximum number of matching accounts to return, default: 40
@spec status(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Retrieve status
Parameters
conn- connection credentialsid- status identifier
@spec status_context(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Context.t()
Retrieve status context
Parameters
conn- connection credentialsid- status identifier
@spec status_history(Hunter.Client.t(), String.t() | non_neg_integer()) :: [ Hunter.StatusEdit.t() ]
Retrieve the edit history of a status
Parameters
conn- connection credentialsid- status identifier
@spec status_source(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.StatusSource.t()
Retrieve the plain-text source of a status, for editing
Parameters
conn- connection credentialsid- status identifier
@spec statuses(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: [ Hunter.Status.t() ]
Get a list of statuses by a user
Parameters
conn- connection credentials -account_id- account identifieroptions- option list
Options
only_media- only returnHunter.Status.tthat have media attachmentsexclude_replies- skip statuses that reply to other statusesmax_id- get a list of statuses with id less than or equal this valuesince_id- get a list of statuses with id greater than this valuelimit- maximum number of statuses to get, default: 20, max: 40
@spec statuses_by_ids(Hunter.Client.t(), [String.t() | non_neg_integer()]) :: [ Hunter.Status.t() ]
Retrieve multiple statuses by id
Parameters
conn- connection credentialsids- list of status identifiers
@spec translate_status(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: Hunter.Translation.t()
Translate a status into some language
Parameters
conn- connection credentialsid- status identifieroptions- option list
Options
lang- ISO 639-1 language code the status should be translated into; defaults to the user's current locale
@spec unblock(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Unblock a user
conn- connection credentialsid- user identifier
@spec unblock_domain(Hunter.Client.t(), String.t()) :: boolean()
Unblock a domain
Parameters
conn- connection credentialsdomain- domain to unblock
@spec unbookmark(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Remove a status from bookmarks
Parameters
conn- connection credentialsid- status identifier
@spec unfavourite(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Undo a favorite of a status
Parameters
conn- connection credentialsid- status identifier
@spec unfollow(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Unfollow a user
Parameters
conn- connection credentialsid- user identifier
@spec unmute(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Relationship.t()
Unmute a user
Parameters
conn- connection credentialsid- user identifier
@spec unmute_conversation(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Unmute a conversation
Parameters
conn- connection credentialsid- status identifier
@spec unpin(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Unpin a status from the user's profile
Parameters
conn- connection credentialsid- status identifier
@spec unread_count(Hunter.Client.t()) :: non_neg_integer()
Retrieve the number of unread notifications, capped by the server
Parameters
conn- connection credentials
@spec unreblog(Hunter.Client.t(), String.t() | non_neg_integer()) :: Hunter.Status.t()
Undo a reblog of a status
Parameters
conn- connection credentialsid- status identifier
@spec update_credentials(Hunter.Client.t(), map()) :: Hunter.Account.t()
Make changes to the authenticated user
Parameters
conn- connection credentialsdata- data payload
Possible keys for payload
display_name- name to display in the user's profilenote- new biography for the useravatar- base64 encoded image to display as the user's avatar (e.g.data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAADrCAYAAAA...)header- base64 encoded image to display as the user's header image (e.g.data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUoAAADrCAYAAAA...)
@spec update_list(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: Hunter.List.t()
Update a list
Parameters
conn- connection credentialsid- list identifieroptions- option list
Options
title- the new title of the listreplies_policy- which replies should be shown in the list, one of:followed,list,noneexclusive- whether members of the list are removed from the home timeline
@spec update_media(Hunter.Client.t(), String.t() | non_neg_integer(), Keyword.t()) :: Hunter.Attachment.t()
Update a media attachment, before it is attached to a status
Parameters
conn- connection credentialsid- attachment identifieroptions- option list
Options
description- plain-text description of the media for accessibilityfocus- two floating points between -1.0 and 1.0, comma-delimitedthumbnail- path of a custom thumbnail image
@spec update_notification_policy(Hunter.Client.t(), Keyword.t()) :: Hunter.NotificationPolicy.t()
Update the notification filtering policy for the user
Parameters
conn- connection credentialsoptions- option list
Options
Each takes one of accept, filter or drop:
for_not_followingfor_not_followersfor_new_accountsfor_private_mentionsfor_limited_accounts
@spec update_push_subscription(Hunter.Client.t(), map()) :: Hunter.WebPushSubscription.t()
Update the data portion of the Web Push subscription
Parameters
conn- connection credentialsdata- map withalertsand/orpolicy
@spec upload_media(Hunter.Client.t(), Path.t(), Keyword.t()) :: Hunter.Attachment.t()
Upload a media file
Parameters
conn- connection credentialsfile- media to be uploadedoptions- option list
Options
description- plain-text description of the media for accessibility (max 420 chars)focus- two floating points, comma-delimited
Note: the v2 media endpoint processes large files asynchronously: the
returned attachment's url may be nil until the server finishes
processing (HTTP 202). The id can be attached to a status with
create_status as soon as processing completes.
@spec user_agent() :: String.t()
User agent of the client
@spec verify_credentials(Hunter.Client.t()) :: Hunter.Account.t()
Retrieve account of authenticated user
Parameters
conn- connection credentials
Examples
iex> conn = Hunter.new([base_url: "https://social.lou.lt", access_token: "123456"])
%Hunter.Client{base_url: "https://social.lou.lt", access_token: "123456"}
iex> Hunter.verify_credentials(conn)
%Hunter.Account{acct: "milmazz",
avatar: "https://social.lou.lt/avatars/original/missing.png",
avatar_static: "https://social.lou.lt/avatars/original/missing.png",
created_at: "2017-04-06T17:43:55.325Z",
display_name: "Milton Mazzarri", followers_count: 4,
following_count: 4,
header: "https://social.lou.lt/headers/original/missing.png",
header_static: "https://social.lou.lt/headers/original/missing.png",
id: "8039", locked: false, note: "", statuses_count: 3,
url: "https://social.lou.lt/@milmazz", username: "milmazz"}
@spec version() :: String.t()
Returns Hunter version
@spec vote(Hunter.Client.t(), String.t() | non_neg_integer(), [non_neg_integer()]) :: Hunter.Poll.t()
Vote on one or more options in a poll
Parameters
conn- connection credentialsid- poll identifierchoices- list of option indices to vote for (zero-based)