问题
For example, I'd like to collect data related to three keywords:
- keyword1
- keyword2
- 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