Skip to content

Commit

Permalink
Merge pull request #41 from Instapaper/master
Browse files Browse the repository at this point in the history
Add function to return entire OAuth dictionary
  • Loading branch information
Matt Carroll committed Jun 30, 2015
2 parents 170339e + 34ab2ab commit 44d8485
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions lib/evernote/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,27 @@ def get_authorize_url(self, request_token):
self._get_endpoint('OAuth.action'),
urllib.quote(request_token['oauth_token']))

def get_access_token(
def get_access_token_dict(
self, oauth_token, oauth_token_secret, oauth_verifier
):
token = oauth.Token(oauth_token, oauth_token_secret)
token.set_verifier(oauth_verifier)
client = self._get_oauth_client(token)

resp, content = client.request(self._get_endpoint('oauth'), 'POST')
access_token = dict(urlparse.parse_qsl(content))
self.token = access_token['oauth_token']
return self.token
access_token_dict = dict(urlparse.parse_qsl(content))
self.token = access_token_dict['oauth_token']
return access_token_dict

def get_access_token(
self, oauth_token, oauth_token_secret, oauth_verifier
):
access_token_dict = self.get_access_token_dict(
oauth_token,
oauth_token_secret,
oauth_verifier
)
return access_token_dict['oauth_token']

def get_user_store(self):
user_store_uri = self._get_endpoint("/edam/user")
Expand Down

0 comments on commit 44d8485

Please sign in to comment.