我想知道一个用户有多少朋友。这是我尝试过的,但它不起作用:
>>> import facebook
>>> graph = facebook.GraphAPI("CAAEr.....XCODEe6bMZD")
>>> profile = graph.get_object('puja41')
>>> friends = graph.get_connections("puja41", "friends")
Traceback (most recent call last):
File "<pyshell#54>", line 1, in <module>
friends = graph.get_connections("puja41", "friends")
File "C:/Documents and Settings/visolank/Desktop/Python/programs\facebook.py", line 112, in get_connections
return self.request(id + "/" + connection_name, args)
File "C:/Documents and Settings/visolank/Desktop/Python/programs\facebook.py", line 298, in request
raise GraphAPIError(response)
GraphAPIError: Unsupported operation
当我尝试 JonasR 的建议时,我得到了:
{
"error": {
"message": "Unsupported operation",
"type": "FacebookApiException",
"code": 100
}
}