python - Twitter - streaming API to get user tweets not working -


twiiter api giving me hell. restrictive.

i tweets given user, so:

import json twython import twython twython import twythonstreamer  #where store credentials    open('creds-twitter.txt') f:     creds = json.load(f)  class tweetstreamer(twythonstreamer):     def on_success(self, data):         if 'text' in data:             print data['text'].encode('utf-8')      def on_error(self, status_code, data):         print status_code         self.disconnect()  streamer = tweetstreamer(creds['consumer_key'], creds['consumer_secret'],                  creds['access_token'], creds['access_token_secret'])  thom_yorke = '110509537'  print streamer.statuses.filter(follow=thom_yorke) 

1) on first try, no results. script stalls there, waiting response.

2) halt process and, on second try, use argument track, so:

streamer.statuses.filter(track = 'radiohead', follow=thom_yorke),  

it filters radiohead, not in conjunction user's tweets.

3) then, on third try, to

print streamer.statuses.filter(follow=thom_yorke) 

i 420 status_code (limit rate). seriously? after 3 tries?

how user tweets, not hitting rate limit?

please help, driving me crazy.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -