cli.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:pocket-cli 作者: rakanalh 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号