diff --git a/twitools/__init__.py b/twitools/__init__.py index e0439b3..005ed29 100644 --- a/twitools/__init__.py +++ b/twitools/__init__.py @@ -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())):