如何检索 Facebook Post 详细信息?
How to Retrieve Facebook Post details?
我可以使用此代码成功查询 post,不幸的是,它 return 的唯一信息是 created_time、消息和 ID。如何获取标题、描述、link 和图片等其他信息?
FB.api(
'/1494363804210145_10152988081617735',
function(response) {
if (response && !response.error) {
$("#postTitle").val(response.caption); // doesn't works
$("#postMessage").val(response.message); // works
$("#postDesc").val(response.description); // doesn't works
$("#postLink").val(response.link); // doesn't works
$("#postImage").val(response.picture); // doesn't works
writeFeedback("Post is loaded.");
}else{
writeFeedback("Error Reading Post: "+response.error.message);
}
}
);
您必须专门传递要从图表 API 返回的字段。这是在 v2.4 中引入的。
见
Declarative Fields
To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /v2.4/me/feed no longer includes likes and comments by default, but GET /v2.4/me/feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.
我可以使用此代码成功查询 post,不幸的是,它 return 的唯一信息是 created_time、消息和 ID。如何获取标题、描述、link 和图片等其他信息?
FB.api(
'/1494363804210145_10152988081617735',
function(response) {
if (response && !response.error) {
$("#postTitle").val(response.caption); // doesn't works
$("#postMessage").val(response.message); // works
$("#postDesc").val(response.description); // doesn't works
$("#postLink").val(response.link); // doesn't works
$("#postImage").val(response.picture); // doesn't works
writeFeedback("Post is loaded.");
}else{
writeFeedback("Error Reading Post: "+response.error.message);
}
}
);
您必须专门传递要从图表 API 返回的字段。这是在 v2.4 中引入的。
见
Declarative Fields
To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /v2.4/me/feed no longer includes likes and comments by default, but GET /v2.4/me/feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.