Learn R Programming

rtweet (version 0.6.9)

create_token: Creating Twitter authorization token(s).

Description

Sends request to generate OAuth 1.0 tokens. Twitter also allows users to create user-only (OAuth 2.0) access token. Unlike the 1.0 tokens, OAuth 2.0 tokens are not at all centered on a host user. Which means these tokens cannot be used to send information (follow requests, Twitter statuses, etc.). If you have no interest in those capabilities, then 2.0 OAuth tokens do offer some higher rate limits. At the current time, the difference given the functions in this package is trivial, so I have yet to verified OAuth 2.0 token method. Consequently, I encourage you to use 1.0 tokens.

Usage

create_token(app = "mytwitterapp", consumer_key, consumer_secret,
  access_token = NULL, access_secret = NULL, set_renv = TRUE)

Arguments

app

Name of user created Twitter application

consumer_key

Application API key

consumer_secret

Application API secret User-owned application must have Read and write access level and Callback URL of http://127.0.0.1:1410.

access_token

Access token as supplied by Twitter (apps.twitter.com)

access_secret

Access secret as supplied by Twitter (apps.twitter.com)

set_renv

Logical indicating whether to save the created token as the default environment twitter token variable. Defaults to TRUE, meaning the token is saved to user's home directory as ".rtweet_token.rds" (or, if that already exists, then .rtweet_token1.rds or .rtweet_token2.rds, etc.) and the path to the token to said token is then set in the user's .Renviron file and re- read to start being used in current active session.

Value

Twitter OAuth token(s) (Token1.0).

See Also

https://developer.twitter.com/en/docs/basics/authentication/overview/oauth

Other tokens: get_tokens, rate_limit