Created
October 20, 2017 15:33
-
-
Save hepplerj/a3e7dfcfa279515e7d0b3eb4b58cf568 to your computer and use it in GitHub Desktop.
Using tweepy to crawl for archives, special collections, and library users.
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 | |
# 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