11

I am writing a twitter app using jtwitter - and its running inside a server inside my work. Anyway - whenever i run it from work it returns the error below and I am only making a couple requests per hour:

HTTP/1.1 400 Bad Request
{"request":"/1/statuses/user_timeline.json?count=6&id=cicsdemo&","error":"Rate limit exceeded. Clients may not make more than 150 requests per hour."} ]
2010-06-03 18:44:49 zero.timer.TimerTask::run Thread-3
    SEVERE [ CWPZA3100E: Exception during processing for timer task, "twitterTimer". Exception: java.lang.ClassCastException: winterwell.jtwitter.Twitter$Status incompatible with java.lang.String ]

I run the same code from home - its fine.

So obviously at some point twitter thinks our work is all coming from one direct IP - which is why its hitting a limit which it shouldnt.

Do I have any choice or workaround - can i make the limit be counted from my direct machine IP - or to my account instead of IP? Can i use a proxy? Has any body else had this problem and solved it?!

Before anyone asks the APP must live inside my work - it cannot run anywhere else!

Cheers,

Andy

Amber
  • 507,862
  • 82
  • 626
  • 550
RenegadeAndy
  • 5,440
  • 18
  • 70
  • 130

3 Answers3

16

Authenticate against an account so that you're using the account's API request limit, not the unauth'd IP limit:

http://dev.twitter.com/pages/rate-limiting

http://dev.twitter.com/pages/auth

If you still have issues, you can ask for whitelisting of the company IP, but for what you're talking about (only a few requests an hour), just auth'ing to an account is the best option.

Amber
  • 507,862
  • 82
  • 626
  • 550
  • This looks good - but the callback URL wouldnt be publicly available which ruins this scheme as I cannot do the authentication manually. How annoying - what does that leave me with? – RenegadeAndy Jun 03 '10 at 21:37
2

You can ask Twitter to move up that limit up to 20000 requests per hour. It's a pretty straightforward process documented on their site.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292
  • This does not appear to be an option for the REST and Search APIs. You can apparently still apply for exceptions when using the Streaming API. – CBono Oct 10 '12 at 20:35
2

You could also consider using their streaming api which is much better(realtime). It will also take care of the limit, because you will only have a request when new data arrives.

CBono
  • 3,803
  • 1
  • 32
  • 40
Alfred
  • 60,935
  • 33
  • 147
  • 186