hunter v0.4.1 Hunter
A Elixir client for Mastodon, a GNU Social compatible micro-blogging service
Summary
Functions
Accepts a follow request
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
Register a new OAuth client app on the target instance
Create new status
Destroy status
Favorite a status
Fetch the list of users who favourited the 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
Load persisted application’s credentials
Retrieve access token
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
Fetch the list of users who reblogged the status
Rejects a follow request
Get the relationships of authenticated user towards given other users
Report a user
Retrieve a user’s reports
Search for content
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
Make changes to the authenticated user
Upload a media file
User agent of the client
Retrieve account of authenticated user
Returns Hunter version
Functions
Deletes all notifications from the Mastodon server for the authenticated user
Parameters
conn- connection credentials
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
create_status(Hunter.Client.t, String.t, non_neg_integer, [non_neg_integer]) :: Hunter.Status.t
Create new status
Parameters
conn- connection credentialstext- [String]in_reply_to_id- [Integer]media_ids- [Array]
Fetch the list of users who favourited the status
Parameters
conn- connection credentialsid- status identifier
Follow a remote user
Parameters
conn- connection credentialsuri- URI of the remote user, in the format ofusername@domain
hashtag_timeline(Hunter.Client.t, [String.t], Keyword.t) :: [Hunter.Status.t]
Retrieve statuses from a hashtag
Parameters
conn- connection credentialshashtag- string list
Options
max_id- [Integer]since_id- [Integer]limit- [Integer]
Retrieve statuses from the home timeline
Parameters
conn- connection credentialsoptions- option list
Options
max_id- [Integer]since_id- [Integer]limit- [Integer]
Retrieve access token
Parameters
app- application details, see:Hunter.Application.create_app/5for more details.username- account’s emailpassword- account’s passwordbase_url- API base url, default:https://mastodon.social
Initializes a client
Options
base_url- URL of the instance you want to connect tobearer_token- [String] OAuth access token for your authenticated user
public_timeline(Hunter.Client.t, Keyword.t) :: [Hunter.Status.t]
Retrieve statuses from the public timeline
Parameters
conn- connection credentialsoptions- option list
Options
max_id- [Integer]since_id- [Integer]limit- [Integer]
Fetch the list of users who reblogged the status.
Parameters
conn- connection credentialsid- status identifier
relationships(Hunter.Client.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
report(Hunter.Client.t, non_neg_integer, [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
Search for content
Parameters
conn- connection credentialsq- the search queryoptions- option list
Options
resolve- whether to resolve non-local accounts
Search for accounts
Parameters
conn- connection credentialsoptions- option list
Options
q: what to search forlimit: maximum number of matching accounts to return, default: 40
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 identifieroptions- option list
Options
max_id- [Integer]since_id- [Integer]limit- [Integer]
Unblock a user
conn- connection credentialsid- user identifier
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...)
User agent of the client
Returns Hunter version