Hi there,
I’m trying to figure out the proper way to retrieve the number of tweets containing a particular string on a particular date, without having to retrieve all of the other data about those tweets.
Because I was sometimes getting back thousands of tweets using the Twitter gem, I decided to switch to just making HTTParty requests to see if that would speed things up.
base_uri = 'https://api.twitter.com/1.1/search/tweets.json'
test_uri = '?q=TWTR%20since%3A2014-09-08%20until%3A2014-09-09'
uri = base_uri + test_uri
response = HTTParty.get(uri,
{
:headers => {'Authorization' => bearer}
})
tweet_count = response['statuses'].count #=> 15
Here is my request, but now I am limited to 15 tweets as opposed to the thousands that I used to get using the Twitter gem.
I know I can do things to get this rate limit increased to 100 tweets, but is there a way to simply just retrieve the number of tweets without having to get all of the tweets themselves?
Having to get all of the tweets in their entirety leads my application to timeout and crash.
Thanks very much for reading! Any suggestions greatly appreciated.