Closed jimsharma206 closed 1 year ago
Where does the corpus
function come from? The check_token_v2
function is not exported, please do not use it. You don't provide rules for the filtered_stream
endpoint. Please check the documentation, read it carefully and test what works before opening an issue.
To insert a token you would only need to have ..., token = app)
or simply use auth_as(app)
and it should be picked up automatically.
What is the output of is(auth_get())
? If it is not rtweet_bearer then you have the incorrect authentication. If it is and fails, or there are crashes, please paste the error if possible. If it is slow and it takes much longer than the timeout this is know and will improve in future releases (hopefully).
I recommend to use a valid filename, having something with a # symbol might not be valid and may cause problems in your OS.
I investigated a bit more, you seem to be using corpus from the quanteda package. But doesn't seem to be related to your problem with the package.
I am sorry to bother you sir, but I simply do not know how to proceed. I entered my bearer token after running the rtweet_app() function. However, when I run stream_bitcoin below, I get the following error: ! A bearer token
is needed for this endpoint.
library(rtweet)
rtweet_app()
stream_bitcoin <- filtered_stream(query="#bitcoin", timeout = 30, parse = FALSE)
You need to say rtweet which token you want to use. See the two lines I added to your example:
library(rtweet)
token <- rtweet_app() # Modified line
auth_as(token) # Added line
stream_bitcoin <- filtered_stream(query="#bitcoin", timeout = 30, parse = FALSE)
This is explained in the Default authentication section of one of the vignettes.
I also recomend you to save your token via
auth_save(token, "my_app")
So next time you won't need to use rtweet_app
but simply load the token via auth_as
Problem
I am looking to stream tweets via the rtweet app. I have all the tokens necessary, including the bearer token. However, I do not know how to insert the bearer token in my code so that it gets authenticated.
Expected behavior
Reproduce the problem
rtweet version
Session info