Add function to authenticate with known cke/cse pair
This commit is contained in:
parent
85f74aea0f
commit
411520ec53
1 changed files with 19 additions and 0 deletions
|
@ -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())):
|
||||
|
|
Loading…
Reference in a new issue