从特定用户列表中获取实时推文...获取重复 tweepy python
Get live tweets from a specific user list... getting duplicates tweepy python
我看过here, here and here。
我有一个 Twitter 用户列表,我想为其 stream live
推文。但我收到了 duplicate
条推文。而且这些推文本身并不是 live
。
代码如下:
users_to_follow = ['twitterid_1', 'twitterid_2', 'twitterid_3']
mystream = tweepy.Stream(self.auth, self.listener)
try:
mystream.filter(follow=users_to_follow)
except:
print("error!")
mystream.disconnect()
它正在恢复推文,但重复了相同的推文。我做错了什么?
干杯
根据 Twitter documentation on the follow
parameter:
follow
A comma-separated list of user IDs, indicating the users whose Tweets
should be delivered on the stream. Following protected users is not
supported. For each user specified, the stream will contain:
- Tweets created by the user.
- Tweets which are retweeted by the user.
- Replies to any Tweet created by the user.
- Retweets of any Tweet created by the user.
- Manual replies, created without pressing a reply
button (e.g. “@twitterapi I agree”).
The stream will not contain:
- Tweets mentioning the user (e.g. “Hello @twitterapi!”).
- Manual Retweets created without pressing a Retweet button (e.g. “RT
@twitterapi The API is great”).
- Tweets by protected users.
当你说 "the same Tweets are being duplicated" 时,你的意思是你多次看到相同的推文 ID?
您还提到了 "Tweets are not live" 但不清楚您的意思。
我看过here, here and here。
我有一个 Twitter 用户列表,我想为其 stream live
推文。但我收到了 duplicate
条推文。而且这些推文本身并不是 live
。
代码如下:
users_to_follow = ['twitterid_1', 'twitterid_2', 'twitterid_3']
mystream = tweepy.Stream(self.auth, self.listener)
try:
mystream.filter(follow=users_to_follow)
except:
print("error!")
mystream.disconnect()
它正在恢复推文,但重复了相同的推文。我做错了什么?
干杯
根据 Twitter documentation on the follow
parameter:
follow
A comma-separated list of user IDs, indicating the users whose Tweets should be delivered on the stream. Following protected users is not supported. For each user specified, the stream will contain:
- Tweets created by the user.
- Tweets which are retweeted by the user.
- Replies to any Tweet created by the user.
- Retweets of any Tweet created by the user.
- Manual replies, created without pressing a reply button (e.g. “@twitterapi I agree”).
The stream will not contain:
- Tweets mentioning the user (e.g. “Hello @twitterapi!”).
- Manual Retweets created without pressing a Retweet button (e.g. “RT @twitterapi The API is great”).
- Tweets by protected users.
当你说 "the same Tweets are being duplicated" 时,你的意思是你多次看到相同的推文 ID?
您还提到了 "Tweets are not live" 但不清楚您的意思。