Twitter Stream not working for Tweepy
Question: Using the code below, I'm trying to get a hash tag. It works fine for larger
searches like #StarWars, but when i ask for smaller ones it doesn't seem to
return anything.

Ideas?

_'code' is used instead of the actual strings for authentication_

    
    
    from tweepy.streaming import StreamListener
    from tweepy import OAuthHandler
    from tweepy import Stream
    from textwrap import TextWrapper
    import json
    
    access_token = "code"
    access_token_secret = "code"
    consumer_key = "code"
    consumer_secret = "code"
    
    class StdOutListener(StreamListener):
        ''' Handles data received from the stream. '''
    
        status_wrapper = TextWrapper(width=60, initial_indent='    ', subsequent_indent='    ')
    
        def on_status(self, status):
            try:
                print self.status_wrapper.fill(status.text)
                print '\n %s  %s  via %s\n' % (status.author.screen_name, status.created_at, status.source)
            except:
                # Catch any unicode errors while printing to console
                # and just ignore them to avoid breaking application.
                pass
    
        def on_error(self, status_code):
            print('Got an error with status code: ' + str(status_code))
            return True # To continue listening
    
        def on_timeout(self):
            print('Timeout...')
            return True # To continue listening
    
    if __name__ == '__main__':
        listener = StdOutListener()
        auth = OAuthHandler(consumer_key, consumer_secret)
        auth.set_access_token(access_token, access_token_secret)
    
        stream = Stream(auth, listener)
        stream.filter(track=['#TestingPythonTweet'])
    


Answer: Ok, so found that the answer to this is that i was expecting it to work retro-
actively. This was a fundamental error on my part. Instead what actually
happens is that it gets what's _currently_ being tweeted. Not was has been
previously.

