Skip to content

Instantly share code, notes, and snippets.

@cristovaov
Created March 4, 2016 10:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cristovaov/98c3501b07025b939275 to your computer and use it in GitHub Desktop.
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
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)
@Python-12345
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment