Does Tweepy support running multiple Streams to collect data?

只谈情不闲聊 提交于 2019-12-20 02:47:12

问题


For example, I'd like to collect data related to three keywords:

  1. keyword1
  2. keyword2
  3. keyword3

I understand that I could collect them all at one time using: set track=[keyword1,keyword2,keyword3]. Is it possible to run three different Python processes to collect data for those keywords separately?


回答1:


Unfortunately, no. Assuming you're using Tweepy's Stream class (which uses the Twitter Streaming API) you can not make multiple connections with a single account. You should also watch out if you try to circumvent this using multiple accounts:

Each account may create only one standing connection to the public endpoints, and connecting to a public stream more than once with the same account credentials will cause the oldest connection to be disconnected.

Clients which make excessive connection attempts (both successful and unsuccessful) run the risk of having their IP automatically banned.

-Twitter Streaming API



来源:https://stackoverflow.com/questions/26477915/does-tweepy-support-running-multiple-streams-to-collect-data

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