Пример #1
0
 def get_access_token(cls, request_token_key, request_token_secret):
     key, secret = service_users.twitter_oauth_creds()
     api = OAuthApi(key,
                    secret,
                    OAuthToken(request_token_key, request_token_secret),
                    cache=None)
     return api.getAccessToken()
Пример #2
0
 def _new_oauth_api(cls, encoded_access_token):
     consumer_key, consumer_secret = service_users.twitter_oauth_creds()
     access_token = oauth.Token.from_string(encoded_access_token)
     return twitter.Api(consumer_key=consumer_key,
                        consumer_secret=consumer_secret,
                        access_token_key=access_token.key,
                        access_token_secret=access_token.secret,
                        cache=TwitterMemcache())
Пример #3
0
 def _new_oauth_api(cls, encoded_access_token):
     consumer_key, consumer_secret = service_users.twitter_oauth_creds()
     access_token = oauth.Token.from_string(encoded_access_token)
     return twitter.Api(consumer_key=consumer_key, consumer_secret=consumer_secret,
         access_token_key=access_token.key, access_token_secret=access_token.secret,
         cache=TwitterMemcache())
Пример #4
0
 def get_access_token(cls, request_token_key, request_token_secret):
     key, secret = service_users.twitter_oauth_creds()
     api = OAuthApi(key, secret, OAuthToken(request_token_key, request_token_secret), cache=None)
     return api.getAccessToken()
Пример #5
0
 def get_request_token_and_auth_url(cls):
     key, secret = service_users.twitter_oauth_creds()
     api = OAuthApi(key, secret, cache=None)
     request_token = api.getRequestToken()
     return request_token, api.getAuthorizationURL(request_token)
Пример #6
0
 def get_request_token_and_auth_url(cls):
     key, secret = service_users.twitter_oauth_creds()
     api = OAuthApi(key, secret, cache=None)
     request_token = api.getRequestToken()
     return request_token, api.getAuthorizationURL(request_token)