jdlm
jdlm

Reputation: 6664

Problem with Tweet! for jQuery

Tweet! for jQuery works fine most of the time, but sporadically I get this:

"NetworkError: 400 Bad Request - http://api.twitter.com/1/statuses/user_timeline.json?screen_name=jlowgren&count=5&include_rts=1&page=1&callback=jQuery16202827138555332698_1313661810432&_=1313661810465

This is the jQuery call:

$(".tweet").tweet({
    username: "jlowgren",
    count: 5,
    loading_text: "Loading tweets…",
    refresh_interval: 120
});

The site in question is www.jorum.se.

Anyone with a handsome solution for this will be richly rewarded in karma!

Upvotes: 3

Views: 2173

Answers (3)

Chamilyan
Chamilyan

Reputation: 9423

It looks like your getting rate limited.

If your application is being rate-limited by the REST API it will receive HTTP 400 response codes. It is best practice for applications to monitor their current rate limit status and dynamically throttle requests if necessary. The REST API offers two ways to observe this status which are explained in the Rate Limiting FAQ.

  • Authenticated (oAuth) requests have a limit of 350 / hour requests

while . .

  • Non authenticated requests have a limit of 150 / hour requests

to see your current rate limit status, send a GET request to

http://api.twitter.com/1/account/rate_limit_status.json


See this page for further context

Upvotes: 3

amelvin
amelvin

Reputation: 9061

I think that you should always assume that the Twitter network will occasionally fail (it always has done to date). So wrap your jquery tweet call in a javascript try catch.

try {  
    $(".tweet").tweet({
    username: "jlowgren",
    count: 5,
    loading_text: "Loading tweets…",
    refresh_interval: 120
});
} catch (error) {  
    // error message or other response goes here  
}  

Upvotes: 3

genesis
genesis

Reputation: 50982

It works fine for me all the time (after few refreshes). Isn't there limit per IP ?

Upvotes: 1

Related Questions