Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hepplerj
Created October 20, 2017 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hepplerj/a3e7dfcfa279515e7d0b3eb4b58cf568 to your computer and use it in GitHub Desktop.
Save hepplerj/a3e7dfcfa279515e7d0b3eb4b58cf568 to your computer and use it in GitHub Desktop.
Using tweepy to crawl for archives, special collections, and library users.
import tweepy
# OAuth is the preferred method for authenticating to Twitter
# Consumer keys are under the application's Details page at
# http://dev.twitter.com/apps
consumer_key = ""
consumer_secret = ""
# Access tokens are found on your applications' Details page
# at http://dev.twitter.com/apps.
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, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
print(api.me().name) # was authentication successful?
users = api.search_users(q="special collections library" [20] [0])
print(users)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment