def configure(consumer_key, sort_field, words_per_minute):
pocket_app.init_consumer_key(consumer_key)
request_token = pocket_app.get_request_token()
if not request_token:
print('Could not obtain request_token')
return
url = 'http://getpocket.com/auth/authorize?request_token={0}' \
'&redirect_uri={1}'.format(request_token, 'http://www.google.com')
print('You will have to authorize the application to access your articles')
print('Enter any key once you\'re redirected to google.com')
print('Or open this link in browser manually:')
print(url);
webbrowser.open_new_tab(url)
input()
access_token = pocket_app.get_access_token(request_token)
if not access_token:
print('Could not obtain access token')
return
pocket_app.configure(consumer_key, access_token,
words_per_minute, sort_field)
print('The application is ready to use')
评论列表
文章目录