我正在从我的新闻流中获取数据来过滤它。这需要Facebook有时超过5秒。我点击Google App Engine的url_fetch()
超时。通过谷歌应用引擎上的Python缓慢的Facebook API(GAE)
现在有什么办法可以解决这个超时或提高Facebook回复我的请求的速度吗?这是我得到我的例外的部分:
params[u'access_token'] = self.access_token
result = json.loads(
urlfetch.fetch(
url=u'https://graph.facebook.com/me/home?limit=1000,
payload=urllib.urlencode(params),
method=urlfetch.POST,
headers={u'Content-Type': u'application/x-www-form-urlencoded'}
).content)
如果来自'urlfetch'的信息最终被发送到浏览器,您还可以考虑在Facebook的Javascript SDK中使用jQuery $ .getJSON()来绕过这个限制。 –