TweetUtils.loadTweet 429 Too many requests


#1

Hi,

I’m using Fabric to show native tweet views. I get back the tweet ids from a webservice and then call TweetUtils.loadTweet(id) to get my tweet view.

The problem is that I quickly reach the rate limit and have 429 errors (too many requests).

I can’t put my tweets in cache because I’m not able to create a new tweet view from the id I have.

Have you an idea to solve my issue ?

Thanks a lot, Rafi.


#2

Hi Rafi,

Have you looked into using TweetUtils.loadTweets(listOfIds, cb) to request multiple ids at one time? Also, feel free to email us at support@fabric.io and we can check what rate limits are set up for your account.

Lien


#3

Hi,

No I don’t use the loading of multiple ids. My app is a list with different types of items like this :

  • Item 0 : TextView
  • Item 1 : ImageView
  • Item 2 : TweetView
  • Item 3 : TextView

So I have to call loadTweet with one id into my customView in order to create the tweetview.


#4

Yes, the tradeoff of using loadTweet is that you may hit rate limits making a request for each Tweet individually in a multi-item context. loadTweet is best for use cases such as detail views in which only one Tweet is needed.

For other cases, especially for multiple items, prefer loadTweets which allows you to load up to 100 Tweets in a single request. It keeps app requests to the Twitter API within limits and keeps network usage reasonable for your users.

For your specific case, consider preloading the ids of the Tweets you will need or making use of Timelines with a custom adapter.


#5