X-Git-Url: https://projects.mako.cc/source/twitter-api-cdsw-solutions/blobdiff_plain/1e2d406ccc7bfaa9c73ab809367ce5ae2ab6fc79..d4653b5f599083dc7631ff1a215096ac58b626d8:/solution-followers-1.py diff --git a/solution-followers-1.py b/solution-followers-1.py new file mode 100644 index 0000000..d200ed2 --- /dev/null +++ b/solution-followers-1.py @@ -0,0 +1,16 @@ +# Q Write a program to find out how many people a particular user follows? + +import encoding_fix +import tweepy +from twitter_authentication import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET + +auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) +auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) + +api = tweepy.API(auth) + +user = api.get_user('makoshark') + +print(user.screen_name + " follows " + str(user.friends_count) + " accounts.") + +