How to construct a Facebook post URL from the post id? [duplicate]

余生长醉 提交于 2019-12-04 19:15:54

问题


Possible Duplicate:
How to construct a permalink for objects returned by Facebook's new Graph API?

The Facebook open graph API allows a public search, e.g.

https://graph.facebook.com/search?q=watermelon

The results returned may be statuses, videos, links, photos (and others?).

Each has a post id, e.g.

100000973592583_149321401769498

I wish to construct a URL to the post. For statuses, this seems to work:

http://www.facebook.com/profile.php?id=100000973592583&v=wall&story_fbid=149321401769498

However, for a link (or video or photo), that often works, but sometimes does not. For example, a link with id

45430244790_127287890653212

needed

http://www.facebook.com/posted.php?id=45430244790&share_id=127287890653212&comments=1#s127287890653212

Does someone have experience creating bulletproof links? Are there any docs on it?

Edit: Suppose I know the type as well (video, post, photo, link, ..)


回答1:


Following FQL:

SELECT permalink
FROM stream
WHERE post_id="45430244790_127287890653212"

would return:

[
  {
    "permalink": "http://www.facebook.com/posted.php?id=45430244790&share_id=127287890653212&comments=1#s127287890653212"
  }
]


来源:https://stackoverflow.com/questions/3689040/how-to-construct-a-facebook-post-url-from-the-post-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!