Package 'untruthr'

Title: What the Package Does (One Line, Title Case)
Description: What the package does (one paragraph).
Authors: First Last [aut, cre] (ORCID: YOUR-ORCID-ID)
Maintainer: First Last <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9000
Built: 2026-05-08 06:00:27 UTC
Source: https://github.com/favstats/untruthr

Help Index


Conditionally apply expressions on a data object

Description

Conditionally apply expressions on a data object

Usage

do_if_else(.data, condition, .if, .else = identity)

Arguments

.data

Input data

condition

A logical value to determine whether to use .if or .else

.if

Formula or function to apply to intput data when condition is TRUE

.else

Formula or function to apply to intput data when condition is FALSE

Value

Output of appropriate .if/.else call


Authenticate with Truth Social

Description

This function authenticates with Truth Social using the provided client ID, client secret, username, and password. If a valid authentication token is already stored in the truth_social_token environment variable, the function will ask if the user wants to refresh the token.

Usage

untruth_auth(
  CLIENT_ID = Sys.getenv("truth_social_client_id"),
  CLIENT_SECRET = Sys.getenv("truth_social_client_secret"),
  username = Sys.getenv("truth_social_user"),
  password = Sys.getenv("truth_social_pw")
)

Arguments

CLIENT_ID

The client ID provided by Truth Social.

CLIENT_SECRET

The client secret provided by Truth Social.

username

The username to use for authentication.

password

The password to use for authentication.

Value

A character string containing the authentication token.


Look up a user by their handle

Description

This function allows you to look up a user by their handle.

Usage

untruth_lookup_users(user_handle, monitor = F, switch_token = NULL, ...)

Arguments

user_handle

The user's handle.

monitor

Whether to monitor the rate limit.

switch_token

Whether to switch the token.

...

Additional parameters to pass to the httr::GET function.

Value

A data frame containing information about the user.

Examples

untruth_lookup_users("realdonaldtrump")

Get suggested users from Truth Social

Description

Get suggested users from Truth Social

Usage

untruth_suggested_users(
  maximum = 20,
  monitor = FALSE,
  switch_token = NULL,
  ...
)

Arguments

maximum

Maximum number of suggestions to return

monitor

If TRUE, show detailed output of the rate limit status

switch_token

If TRUE, use the switch_token function to switch to a new token if rate limits are reached

Value

A data frame of suggested users


Retrieve user statuses on Truth Social

Description

Retrieve user statuses on Truth Social

Usage

untruth_user_statuses(
  user_handle = NULL,
  account_id = NULL,
  limit = 40,
  size = 120,
  verbose = T,
  retry_on_timeout = T,
  switch_token = NULL,
  monitor = F,
  ...
)

Arguments

user_handle

The user's handle on Truth Social

account_id

The user's account ID on Truth Social

limit

The number of statuses to retrieve

size

The number of statuses per pagination

verbose

Whether to print information about pagination

retry_on_timeout

Whether to retry the request if a timeout occurs

switch_token

Whether to use a different API token for this request

monitor

Whether to monitor the API rate limit

Value

A data frame containing the statuses

Examples

untruth_user_statuses("truth_social", account_id = "107780257626128497")
untruth_user_statuses("truth_social")