V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ooof
V2EX  ›  Project Babel

启用 Project Babel 2 内置的 Twitter 客户端没有成功,请教几个问题。

  •  
  •   ooof · 2010-09-20 18:29:27 +08:00 · 4537 次点击
    这是一个创建于 4939 天前的主题,其中的信息可能已经有所发展或是发生改变。
    1. http://dev.twitter.com/apps/new 页面的 Callback URL 填写的是 http://aaaaaaa.appspot.com/settings 不知道对不对。


    2.申请到 Twitter 网站上的 OAuth Consumer Key 和 Secret 了。

    也写入 config.py 了,不知道是不是这样:

    if os.environ['SERVER_SOFTWARE'] == 'Development/1.0':
    twitter_consumer_key = 'aaaaaaaMUWXfQtdpw'
    twitter_consumer_secret = 'aaaaaaaIRMuAzk5oBplLndTzszbcJPLVZs'
    else:
    twitter_consumer_key = 'aaaaaaaIJMUWXfQtdpw'
    twitter_consumer_secret = 'aaaaaaaYZuIRMuAzk5oBplLndTzszbcJPLVZs'



    3.在绑定账户时,前几天是点击后,twitter 的界面出现,工作一会后,返回原地,但小鸟没有出现。

    刚才在 config.py 胡乱改了一下,也恢复原样了,但总出现下面的错误,不知道怎么回事。

    Traceback (most recent call last):
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 511, in __call__
    handler.get(*groups)
    File "/base/data/home/apps/chinango20/1.344933628934134655/t.py", line 49, in get
    request_token = twitter.getRequestToken()
    File "/base/data/home/apps/chinango20/1.344933628934134655/twitter/oauthtwitter.py", line 189, in getRequestToken
    resp = self._FetchUrl(url, no_cache=True)
    File "/base/data/home/apps/chinango20/1.344933628934134655/twitter/oauthtwitter.py", line 101, in _FetchUrl
    url_data = opener.open(url).read()
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 387, in open
    response = meth(req, response)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 498, in http_response
    'http', request, response, code, msg, hdrs)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 425, in error
    return self._call_chain(*args)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
    File "/base/python_runtime/python_dist/lib/python2.5/urllib2.py", line 506, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    HTTPError: HTTP Error 401: Unauthorized
    6 条回复    1970-01-01 08:00:00 +08:00
    ratazzi
        1
    ratazzi  
       2010-09-20 18:38:34 +08:00
    ooof
        2
    ooof  
    OP
       2010-09-20 18:46:38 +08:00
    谢谢 @ratazzi ,改过来了,只是还陷在 3 的泥潭。 :)
    ratazzi
        3
    ratazzi  
       2010-09-20 18:52:40 +08:00
    @ooof 现在又是什么错误?
    ooof
        4
    ooof  
    OP
       2010-09-20 18:54:08 +08:00
    @ratazzi 上面 3 的问题。
    ratazzi
        5
    ratazzi  
       2010-09-20 18:58:46 +08:00
    allow 之后应该是会跳转回去的,另外 twitter 里的 Application Type 必须是 Browser
    ooof
        6
    ooof  
    OP
       2010-09-21 12:52:51 +08:00
    问题解决了 。

    可能是 Callback URL 更改使 OAuth Consumer Key 和 Secret 发生的改变。而当时没有注意到,改成新的后,上传,好了。

    再次谢谢 @ratazzi

    :)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2824 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 13:37 · PVG 21:37 · LAX 06:37 · JFK 09:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.