V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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 · 2013-09-22 23:58:27 +08:00 · 5233 次点击
    这是一个创建于 3862 天前的主题,其中的信息可能已经有所发展或是发生改变。
    从来没有写过类似的代码...龟速摸索中,找到了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
    ```
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1245 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 17:47 · PVG 01:47 · LAX 10:47 · JFK 13:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.