I haven't worked with the Twitter API before.
I have a Sinatra application pushed to Heroku, which makes use of the Twitter gem. The only thing I do in the application (as far as Twitter is concerned) is to pull my 5 latest tweets.
@tweets = Twitter.user_timeline("username").first(5)
However, last night I had trouble getting it to work, Heroku threw an internal server error and the logs tell me:
2011-12-03T11:30:08+00:00 app[web.1]: Twitter::Error::BadRequest - : Rate limit exceeded. Clients may not make more than 150 requests per hour.:
and a stack trace. Restarting the app made it work again.
Today I woke up, checked my heroku app and I got the internal server error again..
What can I do to make this work? Is there a way to make it cache the tweets in case it throws a BadRequest error, or is there a way to get unlimited (or nearly unlimited) requests to Twitter?
I'm not authenticating or anything. Bit confused.