How to use tweepy without filter

I am new to the library tweepy. I can capture the twitter stream if I use a filter like the one shown below and look for tweets containing the word “snow” in the text box.

import tweepy
ckey = ''
csecret = ''
atoken = ''
asecret = ''
auth = OAuthHandler(ckey, csecret)
auth.set_access_token(atoken, asecret)
twitterStream = Stream(auth, listener())
twitterStream.filter(track=["snow"])

However, I don’t know how to capture all the tweets without doing any filtering. If I leave the last line of the above code, the program will start, but I do not receive any tweets. If I change the track parameter to track=[]or track=[""], I get a 406 error code from the Twitter API.

I am using Python 3.4.2.

+4
source share
3 answers

twitterStream.sample() . .

0

. , . stream.sample(). . . Tweepy docs .

+2

API , .
, locations, [-180,-90,180,90], .

, :
twitterStream.filter(locations=[-180,-90,180,90])

, , , .

0

Source: https://habr.com/ru/post/1568014/


All Articles