给定图搜索返回的帖子ID,例如:186173001411937
是否有一个网址链接到Facebook的帖子? 以下网址不起作用: http://www.facebook.com/post.php?id=186173001411937
答案 0 :(得分:48)
我发现,对于图表ID 1099696306_140549259338782,链接是这样构建的: http://www.facebook.com/1099696306/posts/140549259338782
答案 1 :(得分:21)
老实说,我发现这样做的最简单方法就是:
"http://www.facebook.com/" + postId
postId
只是帖子的直接ID(186173001411937),而不是userid_postid变体。
答案 2 :(得分:5)
使用图形api v2.5,您可以使用posts对象的permalink_url字段。
即:
www.facebook.com/v2.5/{pagename}/?fields=posts{permalink_url,message,story,created_time,id}
将返回
"posts": {
"data": [
{
"permalink_url": "https://www.facebook.com/etsmtl/posts/10153868925494376",
"message": "Le Club Cedille organise le prochain Linux-Meetup ce soir à l'ÉTS. Au programme : conférence de James Shubin, ingénieur logiciel sénior chez Red Hat.",
"created_time": "2016-03-01T15:23:11+0000",
"id": "8632204375_10153868925494376"
}, ... }
答案 3 :(得分:2)
对于面向公众的页面帖子,请从Facebook Graph API返回 ID ,例如 12345678_12345678 并将其附加到 facebook.com ,例如https://www.facebook.com/12345678_12345678。当您访问该页面时,帖子也会突出显示。
答案 4 :(得分:0)
public <T>getPagePosts(string pageId, string access_token, int limit)
{
var client = new RestClient("https://graph.facebook.com");
var request = new RestRequest(Method.GET);
var fields = "posts{permalink_url,picture,message,story,created_time,id}";
request.Resource = "{version}/{object_id}/";
request.RequestFormat = DataFormat.Json;
request.JsonSerializer.ContentType = "application/json;";
request.AddParameter("access_token", access_token);
request.AddParameter("version", "v2.10", ParameterType.UrlSegment);
request.AddParameter("object_id", pageId, ParameterType.UrlSegment);
request.AddParameter("limit", limit);
request.AddParameter("fields", fields);
var response = client.Execute(request);
var result = JsonConvert.DeserializeObject<T>(response.Content);
return result;
}