推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
n00b1
V2EX  ›  Python

python-tumblpy :关于Tumblr API授权oauth_verifier获取的问题

  •  
  •   n00b1 · Sep 22, 2013 · 6482 views
    This topic created in 4752 days ago, the information mentioned may be changed or developed.
    从来没有写过类似的代码...龟速摸索中,找到了python-tumblpy这个包,安装好后按照指引:

    1. 在tumblr上创建了app,获取了OAuth Consumer Key和Secret Key
    p.s. 在创建app的时候由于自己没有网址可用,callback url就随便填写了http://www.tumblr.com(这会有问题吗?我搜到stackoverflow上有人说可以这样)
    2. 接下来这段代码获取了auth_url,我在浏览器中打开auth_url被要求Allow访问,点击了Allow按捏后看到了跳转了url中包含了接下来所需的oauth_verifier值。但我也在被卡在这里了,要怎么获取到它呢?用urllib2.open(auth_url),但貌似没有点击Allow按捏获取不到跳转后url啊...

    问题比较菜,还望大家见谅...

    ```
    t = Tumblpy(YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET)

    auth_props = t.get_authentication_tokens(callback_url='http://michaelhelmick.com')
    auth_url = auth_props['auth_url']

    OAUTH_TOKEN_SECRET = auth_props['oauth_token_secret']

    print 'Connect with Tumblr via: %s' % auth_url
    ```
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2557 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 04:50 · PVG 12:50 · LAX 21:50 · JFK 00:50
    ♥ Do have faith in what you're doing.