根据这个:http://developers.facebook.com/docs/reference/api/batch,有一种方法可以使用第一个查询的结果来填充第二个查询。
curl \
-F 'access_token=...' \
-F 'batch=[{ "method": "GET", \
"name" : "get-friends", \
"relative_url": "me/friends?limit=5", \
}, \
{ "method": "GET", \
"relative_url": "?ids={result=get-friends:$.data.*.id}" \
}]' \
https://graph.facebook.com然而,我希望在第一个查询中获得一个页面的帖子,然后获得单个帖子的评论。不确定这是不是可能的,任何帮助是感激的。
curl \
-F 'access_token=...' \
-F 'batch=[{ "method": "GET", \
"name" : "get-posts", \
"relative_url": "cocacola/posts?limit=5", \
}, \
{ "method": "GET", \
"relative_url": "?????" \
}]' \
https://graph.facebook.com发布于 2012-05-03 17:18:45
幸运的是,如果您使用/comments?ids,Facebook允许在一个查询中包含多个对象
curl \
-F 'access_token=...' \
-F 'batch=[{ "method": "GET", \
"name" : "get-posts", \
"relative_url": "cocacola/posts?limit=5", \
}, \
{ "method": "GET", \
"relative_url": "/comments?ids={result=get-posts:$.data.*.id}" \
}]' \
https://graph.facebook.com不幸的是,这比并行执行5个单独的查询要慢。
https://stackoverflow.com/questions/10425231
复制相似问题