How to use the 'count' parameter in tweepy's streaming API?

泪湿孤枕 提交于 2019-12-04 14:10:19

Stream.filter always returns None, its job is just to pass the data on to the StreamListener.

Your problem is that Twitter only allows the count parameter for certain "roles".

Firehose, Links, Birddog and Shadow clients interested in capturing all statuses should maintain a current estimate of the number of statuses received per second and note the time that the last status was received. Upon a reconnect, the client can then estimate the appropriate backlog to request. Note that the count parameter is not allowed elsewhere, including track, sample and on the default access role.

This is the reason you're getting a 413 error when you try to use the count parameter -- you're on the "default access" role.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!