rtweet_user | R Documentation |
Authenticate methods to use the Twitter API.
See the instructions in vignette("auth", package = "rtweet")
.
rtweet_user(
client_id = NULL,
client_secret = NULL,
api_key = client_id,
api_secret = client_secret
)
rtweet_bot(api_key, api_secret, access_token, access_secret, app = "rtweet")
rtweet_app(bearer_token)
rtweet_bearer(client = NULL, scopes = NULL)
rtweet_oauth2(client = NULL, scopes = NULL)
client_id , client_secret |
Application OAuth client ID and client Secret.
These are generally not required for |
api_key , api_secret |
API key and secret. Deprecated in favor of |
access_token , access_secret |
Access token and secret. |
app |
Name of the application you are building. |
bearer_token |
App bearer token. |
client |
Which client app will be used, see |
scopes |
The permissions of the app, see |
There are four ways that you can authenticate with the Twitter API:
rtweet_user()
interactively authenticates an existing Twitter user.
This form is most appropriate if you want rtweet to control your
Twitter account.
rtweet_app()
authenticates as a Twitter application. An application can't
perform actions (i.e. it can't tweet) but otherwise has generally higher
rate limits (i.e. you can do more searches). See details
at https://developer.twitter.com/en/docs/twitter-api/v1/rate-limits.
This form is most appropriate if you are collecting data.
rtweet_bot()
authenticates as bot that takes actions on behalf of an app.
This form is most appropriate if you want to create a Twitter account that
is run by a computer, rather than a human.
rtweet_oauth2()
authenticates as a user using a client.
This authentication is required in some endpoints.
To use rtweet_app()
, rtweet_bot()
or rtweet_oauth2()
you will need to
create your own Twitter app following the instructions in
vignette("auth", package = "rtweet")
.
rtweet_user()
can be used with your own app, but generally there is
no need to because it uses the Twitter app provided by rtweet.
Use auth_as()
to set the default auth mechanism for the current session,
and auth_save()
to save an auth mechanism for use in future sessions.
If the validation is successful the OAuth token.
For rtweet_app()
a rtweet_bearer
.
All of the arguments to these functions are roughly equivalent to
passwords so should generally not be typed into the console (where they
the will be recorded in .Rhistory
) or recorded in a script (which is
easy to accidentally share). Instead, call these functions without arguments
since the default behaviour is to use ask_pass that if possible uses
askpass::askpass()
to interactively safely prompt you for the values.
https://developer.twitter.com/en/docs/authentication/oauth-2-0/authorization-code
rtweet_client()
Other authentication:
auth_as()
,
auth_get()
,
auth_save()
,
auth_setup_default()
## Not run:
rtweet_app()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.