Created
March 4, 2016 10:46
-
-
Save cristovaov/98c3501b07025b939275 to your computer and use it in GitHub Desktop.
Silly tweepy / python script to get names and followers count on the Twitter
This file contains 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
import tweepy | |
# Keys, tokens and secrets | |
consumer_key = "" | |
consumer_secret = "" | |
access_token = "" | |
access_token_secret = "" | |
# Tweepy OAuthHandler | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) | |
targets = [] # All your targets here | |
for target in targets: | |
user = api.get_user(target) | |
print(user.name, user.followers_count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm trying to use the code to store user.name and user.followers_count into a dataframe but I'm not able to do it.
May I know how I can do that?
Thanks!