Facebook 开放图谱帖子的 URL 是什么?

发布于 2024-10-12 09:03:53 字数 219 浏览 1 评论 0原文

给定图形搜索返回的帖子 ID,例如:186173001411937

是否有链接到 facebook 中帖子的 url? 以下网址不起作用: http://www.facebook.com/post.php?id=186173001411937

Given a post id returned by a graph search, for example: 186173001411937

is there a url to link to the post in facebook?
The following url does not work:
http://www.facebook.com/post.php?id=186173001411937

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

感性不性感 2024-10-19 09:03:54

我发现,对于一个图 id 1099696306_140549259338782 的链接是这样构建的:
http://www.facebook.com/1099696306/posts/140549259338782

I found out, for a graph id 1099696306_140549259338782 the links is build like this:
http://www.facebook.com/1099696306/posts/140549259338782

心凉怎暖 2024-10-19 09:03:54

老实说,我发现执行此操作的最简单方法就是:

"http://www.facebook.com/" + postId

其中 postId 只是帖子的直接 ID (186173001411937),而不是 userid_postid 变体。

Honestly, the simplest way I've found to do this is just:

"http://www.facebook.com/" + postId

Where postId is just the straight id of the post (186173001411937), not the userid_postid variant.

不气馁 2024-10-19 09:03:54

通过 graph 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"
   }, ... }

with the graph api v2.5 you can use the permalink_url field of the the posts object.

i.e.:

www.facebook.com/v2.5/{pagename}/?fields=posts{permalink_url,message,story,created_time,id}

will return

"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"
   }, ... }
饭团 2024-10-19 09:03:54

对于面向公众的页面帖子,请获取从 Facebook Graph 返回的 Id API 例如 12345678_12345678 并将其附加到 facebook.com 例如 https://www.facebook.com/12345678_12345678。当您访问该页面时,该帖子也会突出显示

With regards to a public facing page post take the Id returned from the Facebook Graph API e.g. 12345678_12345678 and append it to facebook.com e.g. https://www.facebook.com/12345678_12345678. The post is also highlighted as you access the page.

記柔刀 2024-10-19 09:03:54
 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;
        }
 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;
        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文