Last active
June 30, 2016 18:30
-
-
Save thiagogds/3d546ef9f531ca489ab9a8e0440154aa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| twitter = Twython( | |
| 'key', | |
| 'secret', | |
| "access_token", | |
| "secret_token" | |
| ) | |
| screen_name = 'some_name' | |
| tweets = twitter.get_user_timeline(screen_name=screen_name, count=200) | |
| next_tweets = twitter.get_user_timeline(screen_name=screen_name, count=200, max_id=tweets[-1]['id']) | |
| total = tweets + next_tweets | |
| while next_tweets[-1]['id'] != tweets[-1]['id']: | |
| tweets = twitter.get_user_timeline(screen_name=screen_name, count=200, max_id=next_tweets[-1]['id']) | |
| next_tweets = twitter.get_user_timeline(screen_name=screen_name, count=200, max_id=tweets[-1]['id']) | |
| total += tweets + next_tweets | |
| return filter(lambda x: x['text'][0] != u"@", total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment