Created
August 16, 2017 06:31
-
-
Save kevingduck/96171c1653925f9988ec2fac4b6f1e08 to your computer and use it in GitHub Desktop.
Recent Tweets.py
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
# coding: utf-8 | |
import twitter | |
def main(): | |
accounts = twitter.get_all_accounts() | |
if not accounts: | |
print('No Twitter accounts were found. You can configure Twitter accounts in the settings app. If you have denied access to your accounts when prompted, you can also change your mind there.') | |
account = accounts[0] | |
username = account['username'] | |
print('Loading recent tweets in %s\'s timeline...' % (username,)) | |
tweets = twitter.get_home_timeline(account) | |
for tweet in tweets: | |
print('%s:\n\n%s' % (tweet['user']['screen_name'], tweet['text'])) | |
print('-' * 40) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment