Mining Using TwitteR with Timeframes

Hello,
I'm very new to R and have been trying for a while to get TwitteR to work. I'm currently working on a research project that specifies implementing specific timeframes in my searches. I want to do sentiment analysis before, during, and after a sexual harassment accusation. My code seems to run fine until I attempt to implement timeframes. However, I am following the timeframes code given on the TwitteR package. I upgraded my API to the paid version hoping maybe that would help but I still run into the same issue that the API cannot return my number, even when I only request 1 and the word is generic such as the, which no matter what timeframe would have to had been used. Any advice? Are there any workarounds this? I'm honestly desperate at this point and any help is much appreciated.
Thank you!
Code below for reference (with keys removed)
api_key <- ""

api_secret <- ""

access_token <- ""

access_token_secret <- ""

library(twitteR)

setup_twitter_oauth(api_key, api_secret, access_token, access_token_secret)

tweets <- searchTwitteR("a", n=1, lan="en", since="2020-02-01", until="2020-02-02")

Hi,

Welcome to the RStudio community!

In the recent climate of social media scandals and privacy laws tightening, the APIs for the major social media have severely limited the amount of data a user can get from them. The last update for the twitterR package was in 2016, so I wouldn't be surprised if some of the API calls in the background are no longer valid.

Furthermore, I found in a related post that twitter these days only allows a random sample of tweets posted in the last 7 days based on your criteria


So unfortunately for more rigorous data analysis this API is becoming more and more useless it seems (they know how powerful data has become...)

You can find all API options and restrictions here:
https://developer.twitter.com/en/docs/tweets/batch-historical/api-reference/historical-powertrack

Hope this helps,
PJ

I highly recommend working with rtweet rather that twitteR (as does the maintainer of twitteR). From the archived twitteR GitHub repo:

DEPRECATION

This is the start of a relatively leisurely deprecation period for twitteR , in favor of using rtweet . Please start looking to switch over to that package. If you have any questions contact myself or @mkearney

You can learn all about rtweet here:

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.