问题描述
我正在寻找这个约2周,但找不到任何东西。关于这一点的每一个回应都是指旧版的Facebook API。我可以得到一个Facebook页面的饲料,但我也想得到这些帖子的评论和评论。我正在玩图形浏览器,但找不到任何解决方案。
如果有人知道并与我分享,我真的很感激。
提前谢谢! >
这里我的GET请求:
GraphRequest g = new GraphRequest(
AccessToken.getCurrentAccessToken(),
url,
null,
HttpMethod.GET,
new GraphRequest.Callback(){
public void onCompleted(GraphResponse response){
//我的代码
}
}
);
Bundle parameters = new Bundle();
parameters.putString(fields,full_picture,message,type,source,created_time,id);
parameters.putString(limit,50);
g.setParameters(parameters);
g.executeAsync();
你应该看看文档: / p>
示例调用将是
GET /BuzzFeed/posts?limit=1&fields=id,message,full_picture,type,source,created_time,comments.summary(true).limit(0),likes.summary(true).limit(0)
从页面中获取最新的 BuzzFeed
获取您想要的详细信息:
{
data:[
{
id:21898300328_10153915728380329,
message:I am searching for this for about 2 weeks but cannot find anything. Every response about that refers to an older version of Facebook API. I can get feed of a facebook page, but I want to get like and comment counts for those posts too. I am playing with Graph Explorer but can not find any solution.
I really appreciate if anyone knows it and shares with me.
Thank you in advance!
Here my GET request:
GraphRequest g = new GraphRequest(
AccessToken.getCurrentAccessToken(),
url,
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
// my code
}
}
);
Bundle parameters = new Bundle();
parameters.putString("fields", "full_picture,message,type,source,created_time,id");
parameters.putString("limit","50");
g.setParameters(parameters);
g.executeAsync();
解决方案 You should have had a look on the docs:
- https://developers.facebook.com/docs/graph-api/reference/object/likes
- https://developers.facebook.com/docs/graph-api/reference/object/comments
A sample call would be
GET /BuzzFeed/posts?limit=1&fields=id,message,full_picture,type,source,created_time,comments.summary(true).limit(0),likes.summary(true).limit(0)
which fetches the most recent BuzzFeed
post from the page and gets the details you want:
{ "data": [ { "id": "21898300328_10153915728380329", "message": " 这篇关于Android Facebook - 如何获得一个帖子的数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!