Hunter.Status (hunter v0.6.0)

Copy Markdown View Source

Status entity

Fields

  • id - status id
  • uri - a Fediverse-unique resource ID
  • url - URL to the status page (can be remote)
  • account - the Hunter.Account which posted the status
  • in_reply_to_id - nil or the ID of the status it replies to
  • in_reply_to_account_id - nil or the ID of the account it replies to
  • reblog - nil or the reblogged Hunter.Status
  • content - body of the status; this will contain HTML (remote HTML already sanitized)
  • created_at - time the status was created
  • reblogs_count - number of reblogs for the status
  • favourites_count - number of favourites for the status
  • reblogged - whether the authenticated user has reblogged the status
  • favourited - whether the authenticated user has favourited the status
  • muted - whether the authenticated user has muted the conversation this status from
  • sensitive - whether media attachments should be hidden by default
  • spoiler_text - if not empty, warning text that should be displayed before the actual content
  • visibility - one of: public, unlisted, private, direct
  • media_attachments - A list of Hunter.Attachment
  • mentions - list of Hunter.Mention
  • tags - list of Hunter.Tag
  • application - Hunter.Application from which the status was posted
  • language - detected language for the status, default: en
  • card - preview card generated for links in the status, if any

NOTE: When spoiler_text is present, sensitive is true

Summary

Functions

Destroy status

Favorite a status

Fetch a user's favourites

Retrieve statuses from a hashtag

Retrieve statuses from the home timeline

Retrieve statuses from the public timeline

Reblog a status

Retrieve status

Get a list of statuses by a user

Undo a favorite of a status

Undo a reblog of a status

Types

status_id()

@type status_id() :: non_neg_integer()

t()

@type t() :: %Hunter.Status{
  account: Hunter.Account.t(),
  application: Hunter.Application.t(),
  card: Hunter.Card.t() | nil,
  content: String.t(),
  created_at: String.t(),
  favourited: boolean(),
  favourites_count: non_neg_integer(),
  id: non_neg_integer(),
  in_reply_to_account_id: term(),
  in_reply_to_id: non_neg_integer(),
  language: String.t(),
  media_attachments: [Hunter.Attachment.t()],
  mentions: [Hunter.Mention.t()],
  muted: boolean(),
  reblog: t() | nil,
  reblogged: boolean(),
  reblogs_count: non_neg_integer(),
  sensitive: boolean(),
  spoiler_text: String.t(),
  tags: [Hunter.Tag.t()],
  uri: String.t(),
  url: String.t(),
  visibility: term()
}

Functions

create_status(conn, status, options \\ [])

@spec create_status(Hunter.Client.t(), String.t(), Keyword.t()) :: t() | no_return()

Create new status

Parameters

  • conn - connection credentials
  • status - text of the status
  • options - option list

Options

  • in_reply_to_id - local ID of the status you want to reply to
  • media_ids - list of media IDs to attach to the status (maximum: 4)
  • sensitive - whether the media of the status is NSFW
  • spoiler_text - text to be shown as a warning before the actual content
  • visibility - either direct, private, unlisted or public

destroy_status(conn, id)

@spec destroy_status(Hunter.Client.t(), status_id()) :: boolean()

Destroy status

Parameters

  • conn - connection credentials
  • id - status identifier

favourite(conn, id)

@spec favourite(Hunter.Client.t(), status_id()) :: t()

Favorite a status

Parameters

  • conn - connection credentials
  • id - status identifier

favourites(conn, options \\ [])

@spec favourites(Hunter.Client.t(), Keyword.t()) :: [t()]

Fetch a user's favourites

Parameters

  • conn - connection credentials
  • options - option list

Options

  • max_id - get a list of favourites with id less than or equal this value
  • since_id - get a list of favourites with id greater than this value
  • limit - maximum of favourites to get, default: 20, max: 40

hashtag_timeline(conn, hashtag, options \\ [])

@spec hashtag_timeline(Hunter.Client.t(), [String.t()], Keyword.t()) :: [t()]

Retrieve statuses from a hashtag

Parameters

  • conn - connection credentials
  • hashtag - string list
  • options - option list

Options

  • local - only return statuses originating from this instance
  • max_id - get a list of timelines with id less than or equal this value
  • since_id - get a list of timelines with id greater than this value
  • limit - maximum number of statuses on the requested timeline to get, default: 20, max: 40

home_timeline(conn, options \\ [])

@spec home_timeline(Hunter.Client.t(), Keyword.t()) :: [t()]

Retrieve statuses from the home timeline

Parameters

  • conn - connection credentials
  • options - option list

Options

  • max_id - get a list of timelines with id less than or equal this value
  • since_id - get a list of timelines with id greater than this value
  • limit - maximum number of statuses on the requested timeline to get, default: 20, max: 40

public_timeline(conn, options \\ [])

@spec public_timeline(Hunter.Client.t(), Keyword.t()) :: [t()]

Retrieve statuses from the public timeline

Parameters

  • conn - connection credentials
  • options - option list

Options

  • local - only return statuses originating from this instance
  • max_id - get a list of timelines with id less than or equal this value
  • since_id - get a list of timelines with id greater than this value
  • limit - maximum number of statuses on the requested timeline to get, default: 20, max: 40

reblog(conn, id)

@spec reblog(Hunter.Client.t(), status_id()) :: t()

Reblog a status

Parameters

  • conn - connection credentials
  • id - status identifier

status(conn, id)

@spec status(Hunter.Client.t(), status_id()) :: t()

Retrieve status

Parameters

  • conn - connection credentials
  • id - status identifier

statuses(conn, account_id, options \\ [])

@spec statuses(Hunter.Client.t(), status_id(), Keyword.t()) :: [t()]

Get a list of statuses by a user

Parameters

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

Options

  • only_media - only return Hunter.Status.t that have media attachments
  • exclude_replies - skip statuses that reply to other statuses
  • max_id - get a list of statuses with id less than or equal this value
  • since_id - get a list of statuses with id greater than this value
  • limit - maximum number of statuses to get, default: 20, max: 40

unfavourite(conn, id)

@spec unfavourite(Hunter.Client.t(), status_id()) :: t()

Undo a favorite of a status

Parameters

  • conn - connection credentials
  • id - status identifier

unreblog(conn, id)

@spec unreblog(Hunter.Client.t(), status_id()) :: t()

Undo a reblog of a status

Parameters

  • conn - connection credentials
  • id - status identifier