Fixed key error in some tweets
[twitter-api-cdsw-solutions] / twitter2.py
1 import tweepy
2 from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
3
4 auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
5 auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
6
7 api = tweepy.API(auth)
8
9 user = api.get_user('makoshark')
10
11 print(user.screen_name + " has " + str(user.followers_count) + " followers.")
12
13 print("They include these 100 people:")
14
15 for friend in user.friends(count=100):
16    print(friend.screen_name)
17

Benjamin Mako Hill || Want to submit a patch?