I've been having some troubles using the GetStreamFilter
function from the Python-Twitter library.
I have used this code:
import twitter
import time
consumer_key = 'myConsumerKey'
consumer_secret = 'myConsumerSecret'
access_token = 'myAccessToken'
access_token_secret = 'myAccessTokenSecret'
apiTest = twitter.Api(consumer_key,
consumer_secret,
access_token,
access_token_secret)
#print(apiTest.VerifyCredentials())
while (True):
stream = apiTest.GetStreamFilter(None, ['someWord'])
try:
print(stream.next())
except:
print ("No posts")
time.sleep(3)
What I want to do is to fetch new tweets that include the word "someWord", and to do these every three seconds (or every time there's a new one that is published).