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

Benjamin Mako Hill || Want to submit a patch?