twitter超过谷歌应用程序引擎的速率限制 [英] twitter Rate limit exceeded google app engine

查看:171
本文介绍了twitter超过谷歌应用程序引擎的速率限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是谷歌应用程序引擎,并希望从给定用户下载推文。

I am using google app engine and would like to download tweets from a given user.

我简单地调用 http://api.twitter.com/1/statuses/user_timeline/USERNAME.json

但是几乎总是(大约99%的时间)我会得到超出速率限制,客户端每小时可能发出超过150个请求这个问题与Google App Engine云基础架构有关?我该怎么办? (例如,将数据存储在其他服务器上,然后从那里调用...)

But almost always (About 99% of times) I get "Rate limit exceeded. Clients may not make more than 150 requests per hour" does this problem has something to do with Google App Engine Cloud inrastructure ? What shall I do? (for example storing data on other server and then call from there...)

推荐答案


这个问题与Google App Engine云
基础架构有关

does this problem has something to do with Google App Engine Cloud inrastructure

是。

您要调用的API方法是限制费率

The API method you're calling is rate-limited:


REST API调用
的默认速率限制为每小时150个请求。
REST API的帐户和
基于IP的速率限制。已认证的
API调用收取
认证用户的限额,而
未经认证的API调用从调用IP地址'
分配中扣除

The default rate limit for calls to the REST API is 150 requests per hour. The REST API does account- and IP-based rate limiting. Authenticated API calls are charged to the authenticating user's limit while unauthenticated API calls are deducted from the calling IP address' allotment.

如果您的应用具有专用IP,在App Engine上,许多应用程序可能会为他们的urlfetch请求使用相同的源IP,因此对Twitter API的未经验证的请求将全部从相同的配额中抽取。

This works fine if your app has a dedicated IP; on App Engine, many applications will potentially use the same source IP for their urlfetch request, so unauthenticated requests to the Twitter API will all draw from the same quota.

没有经过测试,但我的理解是,即使对于不需要认证的呼叫,如果您选择认证您的请求,它也将被计入您的帐户配额而不是共享IP配额。

I haven't tested this, but my understanding is that even for calls that don't require authentication, if you choose to authenticate your request it will be counted against your account quota instead of the shared IP quota.

Nick Johnson发布了 a教程,介绍如何从App Engine向Twitter发送认证的API调用。

Nick Johnson posted a tutorial on how to send authenticated API calls to Twitter from App Engine.

这篇关于twitter超过谷歌应用程序引擎的速率限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆