I am getting this Error: Not a valid access token when I try to access streaming api,
but work just fine for search api. I using rtweet package on R.
Is there any way to fix this?
Thank you.
Thanks for writing in here. Have you been able to connect using rtweet in the past? From my experience with rtweet, after you run your first line of code you typically will see a message that says the following:
Authorize the rstats2twitter app by logging into Twitter, or selecting ‘Authorize app’
After you select “Authorize app” you will should see the following message
Authentication complete. Please close this page and return to R.
Is this something that you’ve seen? Are you using R studio as your IDE?
Thank you for your respon.
I am not seeing that messages.
yes I am using R studio and it work fine in the past.
this is my code in R studio.
library(“rtweet”)
library(“ROAuth”)
token ← create_token(
app = “—”,
consumer_key = “—”,
consumer_secret = “—”,
access_token = “—”,
access_secret = “—”)
coordinate ← c(104.5, -7, 106.5, -5)
stream_tweets(
coordinate,
timeout = 606024*7,
file_name = “—.json”,
parse = FALSE
)
Thanks for following up here, when I’ve used rtweet in the past, I’ve used it without creating the token from ROAuth.
To search for Tweets, I’ve used this method in the documentation for the package:
## search for 18000 tweets using the rstats hashtag
rt <- search_tweets(
"#rstats", n = 18000, include_rts = FALSE
)
Hope this helps!
Jess
system
Closed
#5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.