Hunter.Client (hunter v0.6.0)

Copy Markdown View Source

Defines a Hunter client

Summary

Types

t()

@type t() :: %Hunter.Client{access_token: String.t(), base_url: String.t()}

Functions

log_in(app, username, password, base_url \\ "https://mastodon.social")

@spec log_in(Hunter.Application.t(), String.t(), String.t(), String.t()) :: t()

Retrieve access token

Parameters

  • app - application details, see: Hunter.Application.create_app/5 for more details.
  • username - your account's email
  • password - your password
  • base_url - API base url, default: https://mastodon.social

log_in_oauth(app, oauth_code, base_url \\ "https://mastodon.social")

@spec log_in_oauth(Hunter.Application.t(), String.t(), String.t()) :: t()

Retrieve access token

Parameters

  • app - application details, see: Hunter.Application.create_app/5 for more details.
  • oauth_code - oauth authentication code
  • base_url - API base url, default: https://mastodon.social

new(options \\ [])

@spec new(Keyword.t()) :: t()

Initializes a client

Options

  • base_url - URL of the instance you want to connect to
  • access_token - [String] OAuth access token for your authenticated user

user_agent()

@spec user_agent() :: String.t()

User agent of the client