Closed etiennekintzler closed 4 years ago
When i executed below code to create a token it showing me an error
create_token(app = "mytwitterapp", consumer_key, consumer_secret,
set_renv = TRUE)
Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Unauthorized (HTTP 401).
can you please help me to get out it. plz
@skjainmiah You need to set your call back URL in twitter to http://127.0.0.1:1410. This will get rid of your error.
@etiennekintzler Could you please share the approach how you were able to authenticate with the application?
Will that work with hosted RStudio? I can't seem to get the callback to work.
@rajaramana I wrote it in a gist
https://gist.github.com/etiennekintzler/d51fa61068294819c1de61b723942b96
Since June, 2018, the package has supported bearer tokens with the bearer_token
function. This provides application-only authentication to Twitter (and thus higher API rate limits).
Example:
twitter_token <- create_token(
app = "my_twitter_app",
consumer_key = "<redacted>",
consumer_secret = "<redacted>",
access_token = "<redacted>",
access_secret = "<redacted>")
b_token <- bearer_token(twitter_token)
search_tweets("#rstats", n = 10, token = b_token)
The application authentification is not available.
The benefits of this authentification would be increased limit rate (https://developer.twitter.com/en/docs/basics/rate-limits)
The process to use application-only auth is explained here (https://developer.twitter.com/en/docs/basics/authentication/overview/application-only ).
I have already written code to use this kind of authentification (but it is not integrated with the other rtweet functions), which I can share it with you.
Thank you very much