waney
waney

Reputation: 402

Twitter app development best practices?

Let's imagine app which is not just another way to post tweets, but something like aggregator and need to store/have access to tweets posted throught.

Since twitter added a limit for API calls, app should/may use some cache, then it should periodically check if tweet was not deleted etc.

How do you manage limits? How do you think good trafficed apps live while not whitelistted?

Upvotes: 7

Views: 744

Answers (2)

Robert MacLean
Robert MacLean

Reputation: 39260

Well you have 100 requests per hour, so the question is how do you balance it between the various types of requests. I think the best option is the way is how TweetDeck which allows you to set the percentage and saves the rest of the % for posting (because that is important too): alt text
(source: livefilestore.com)

Around the caching a database would be good, and I would ignore deleted ones - once you have downloaded the tweet it doesn't matter if it was deleted. If you wanted to, you could in theory just try to open the page with the tweet and if you get a 404 then it's been deleted. That means no cost against the API.

Upvotes: 3

Mark Biek
Mark Biek

Reputation: 150849

To name a few.

  • Aggressive caching. Don't call out to the API unless you have to.
    • I generally pull down as much data as I can upfront and store it somewhere. Then I operate off the local store until it runs out and needs to be refreshed.
  • Avoid doing things in real time. Queue up requests and make them on a timer.
    • If you're on Linux, cronjobs are the easiest way to do this.
  • Combine requests as much as possible.

Upvotes: 5

Related Questions