Authenticate.mastodon: Mastodon API authentication

View source: R/Authenticate.mastodon.R

Authenticate.mastodonR Documentation

Mastodon API authentication

Description

Mastodon OAuth authentication.

Usage

## S3 method for class 'mastodon'
Authenticate(
  socialmedia,
  instance = NULL,
  type = "public",
  verbose = FALSE,
  ...
)

Arguments

socialmedia

Character string. Identifier for social media API to authenticate, set to "mastodon".

instance

Character string. Server to authenticate against and create token.

type

Character string. Type of access, can be "public" or "user". Default is "public".

verbose

Logical. Output additional information. Default is FALSE.

...

Additional parameters passed to function. Not used in this method.

Value

A credential object containing an access token $auth and social media type descriptor $socialmedia set to "mastodon". Object has the class names "credential" and "mastodon".

Note

vosonSML uses the rtoot package for Mastodon data collection and API access tokens.

Examples

## Not run: 
# mastodon API public access bearer token
mastodon_auth <- Authenticate(
  "mastodon",
  instance = "mastodon.social"
)

# mastodon API user access bearer token
mastodon_auth_user <- Authenticate(
  "mastodon",
  instance = "mastodon.social",
  type = "user"
)

# if thread collection API token not required
mastodon_auth <- Authenticate("mastodon")

## End(Not run)


vosonlab/vosonSML documentation built on April 28, 2024, 6:26 a.m.