try:
redirect_url = auth.get_authorization_url()
except tweepy.TweepError:
- print 'Error! Failed to get request token.'
+ print('Error! Failed to get request token.')
This call requests the token from twitter and returns to us the
authorization URL where the user must be redirect to authorize us. Now
try:
auth.get_access_token(verifier)
except tweepy.TweepError:
- print 'Error! Failed to get access token.'
+ print('Error! Failed to get access token.')
It is a good idea to save the access token for later use. You do not
need to re-fetch it each time. Twitter currently does not expire the
for follower in limit_handled(tweepy.Cursor(api.followers).items()):
if follower.friends_count < 300:
- print follower.screen_name
+ print(follower.screen_name)