Add function to authenticate with known cke/cse pair

This commit is contained in:
Klaus-Uwe Mitterer 2017-02-26 20:12:21 +01:00
parent 85f74aea0f
commit 411520ec53

View file

@ -24,6 +24,25 @@ class twObject:
def tweet(self, text, reply = 0):
return self.api.update_status(text, reply)
def authenticate(self):
try:
authurl = self.auth.get_authorization_url()
except tweepy.TweepError:
return False
print(authurl)
print()
pin = input("PIN: ")
print()
try:
self.auth.get_access_token(pin)
except tweepy.TweepError:
return False
return self.auth.access_token, self.auth.access_token_secret
def getFollowerIDs(section = setuptools.TWITTER):
''' Returns 5,000 follower IDs at most '''
for id in list(twoHelper(section).api.followers_ids(screen_name=twObject().whoami())):