Skip to content

Instantly share code, notes, and snippets.

@Jawn78
Created February 13, 2018 18:46
Show Gist options
  • Save Jawn78/325941efe1732e5d4d191b2b0d417f7c to your computer and use it in GitHub Desktop.
Save Jawn78/325941efe1732e5d4d191b2b0d417f7c to your computer and use it in GitHub Desktop.
Tweepy - Python API Code
import tweepy
auth = tweepy.OAuthHandler("Auth- Handler", "Auth Acces Handler")
# Redirect user to Twitter to authorize
redirect_user(auth.get_authorization_url())
# Get access token
auth.get_access_token("verifier_value")// Access Token
# Construct the API instance
api = tweepy.API(auth)
# Iterate through all of the authenticated user's friends
for friend in tweepy.Cursor(api.friends).items():
# Process the friend here
process_friend(friend)
# Iterate through the first 200 statuses in the friends timeline
for status in tweepy.Cursor(api.friends_timeline).items(200):
# Process the status here
process_status(status)
@lavarthan
Copy link

where did you define the process_friend and process_status function?

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