Facebook graph api 无法获得facebook tornado连接

Facebook graph api 无法获得facebook tornado连接,facebook-graph-api,tornado,Facebook Graph Api,Tornado,我有一个问题,我是一个初学者,我尝试制作一个简单的异步程序,发布到facebook,我使用和,下面是代码: class MainHandler(BaseHandler, tornado.auth.FacebookGraphMixin): @tornado.web.authenticated @tornado.web.asynchronous def get(self): self.facebook_request("/me/home", self.prin

我有一个问题,我是一个初学者,我尝试制作一个简单的异步程序,发布到facebook,我使用和,下面是代码:

class MainHandler(BaseHandler, tornado.auth.FacebookGraphMixin):
    @tornado.web.authenticated
    @tornado.web.asynchronous
    def get(self):
        self.facebook_request("/me/home", self.print_callback, access_token=self.current_user["access_token"])
        a = self.current_user["access_token"]
        #print a

    def print_callback(data):
        print data
        ioloop.stop()
        graph.get_object('/facebook', callback=print_callback)
我得到了这个错误:

TypeError: print_callback() takes exactly 1 argument (2 given)
[E 121009 14:28:47 web:1108] Uncaught exception GET / (::1)
HTTPRequest(.....)
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\web.py", line 1043, in _stack_context_handle_exception
   raise_exc_info((type, value, traceback))
   File "C:\Python27\lib\site-packages\tornado-2.4.post1 py2.7.egg\tornado\stack_context.py", line 237, in _nested
    yield vars
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\stack_context.py", line 210, in wrapped
    callback(*args, **kwargs)
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\gen.py", line 405, in inner self.set_result(key, result)
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\gen.py", line 335, in set_result
    self.run()
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\gen.py", line 365, in run
    yielded = self.gen.send(next)
  File "build\bdist.win-amd64\egg\facebook\graphapi.py", line 129, in _make_request
    raise GraphAPIError(data)
GraphAPIError: (#200) This API call requires a valid app_id.
因为我想了解这个示例以获取令牌,然后使用该示例:

def callback(response):
    # ...
graph.put_object('me', 'feed', message="Maoe!!", callback=callback)
为了在我的facebook的墙上写点东西,我用了,但很遗憾这是阻止

更新:仍在获取错误信息:

class MainHandler(BaseHandler, tornado.auth.FacebookGraphMixin):
    @tornado.web.authenticated
    @tornado.web.asynchronous
    def get(self):
        self.facebook_request("/me/home", self.print_callback, access_token=self.current_user["access_token"])
        a = self.current_user["access_token"]
        print a

    def print_callback(self, data):
        graph.post_wall(self, "heloooooooo")
得到了这个错误:

TypeError: print_callback() takes exactly 1 argument (2 given)
[E 121009 14:28:47 web:1108] Uncaught exception GET / (::1)
HTTPRequest(.....)
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\web.py", line 1043, in _stack_context_handle_exception
   raise_exc_info((type, value, traceback))
   File "C:\Python27\lib\site-packages\tornado-2.4.post1 py2.7.egg\tornado\stack_context.py", line 237, in _nested
    yield vars
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\stack_context.py", line 210, in wrapped
    callback(*args, **kwargs)
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\gen.py", line 405, in inner self.set_result(key, result)
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\gen.py", line 335, in set_result
    self.run()
  File "C:\Python27\lib\site-packages\tornado-2.4.post1-py2.7.egg\tornado\gen.py", line 365, in run
    yielded = self.gen.send(next)
  File "build\bdist.win-amd64\egg\facebook\graphapi.py", line 129, in _make_request
    raise GraphAPIError(data)
GraphAPIError: (#200) This API call requires a valid app_id.
当我访问Facebook时,我看到我正在使用的是一个valide密钥,我甚至使用生成的令牌(这里是
a
变量),并将其粘贴到Api Debug,我让一切都正常工作:

 Valid : True
 Origin : Web
 Scopes : create_note photo_upload publish_actions publish_stream read_stream share_item status_update video_upload

self
添加到
print\u回调

def print_callback(self, data):
    print data
    ioloop.stop()
    graph.get_object('/facebook', callback=print_callback)
这就是著名的“显式优于隐式”;)非常感谢。