Rate limit exceeded. Clients may not make more than 150 requests per hour

本文描述”Rate limit exceeded. Clients may not make more than 150 requests per hour” 的解决办法

昨天做空姐的twitter自动翻译+Retweet程序的时候遇到的问题(使用GAE+twitter4j+google translate API)

调用twitter4j API去查询空姐最新状态的时候,一直报这个错 “Rate limit exceeded. Clients may not make more than 150 requests per hour”,月光博客也遇到过这个问题,认为这个是GAE IP不是白名单的问题,难道没有解决办法了?

有很多基于GAE的twitter应用,如果大家都这样那岂不是要疯掉了。。。所以我想肯定不关白名单啥事情,一定有别的解决办法。

后来我在google code里查到一条类似的issue ,幸运的是已经fix了

所以这个问题解决办法就是:修改searchURL为 http://api.twitter.com/1/search.json (实效性不能保证,至少目前这个方法works)

如果遇到问题的各位童鞋也用的是twitter4j,大家会发现twitter4j jar已经封装好了,默认的searchBaseURL是http://search.twitter.com/search.json,我看了一下twitter4j的源码,对于[基于GAE的]web项目,我们可以在WEB-INF/下面新建一个twitter4j.properties,然后增加这一行searchBaseURL=http://api.twitter.com/1/

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>