从Facebook News Feed API获取高分辨率照片

时间:2014-09-07 12:40:14

标签: facebook facebook-graph-api get facebook-timeline

我正在尝试从我的新闻Feed中的帖子中获取高分辨率照片。我尝试使用object_id根据此处的建议(https://graph.facebook.com/v2.1/10154603506630195)调用getting high resolution photos that were posted on a page wall/feed,但它似乎无法正常工作,我们将非常感谢任何帮助:)

{
  "id": "10154603665915195_10154603509055195", 
  "from": {
    "id": "10154603665915195", 
    "name": "John Smith"
  }, 
  "message": "I've taken up queuing as a new hobby during my short time in England. Here we are outside a store that won't open for another half hour...", 
  "picture": "https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-xpf1/v/t34.0-12/s130x130/10699259_10154603507605195_419931109_n.jpg?oh=ff3ec0e772fea164bbd9d61e9ee9a4d0&oe=540E80D2&__gda__=1410242521_d3b2dc1c8f971610b07e0408cd62815b", 
  "link": "https://www.facebook.com/photo.php?fbid=10154603506630195&set=a.10150303996795195.555860.698310194&type=1&relevant_count=1", 
  "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yx/r/og8V99JVf8G.gif", 
  "actions": [
    {
      "name": "Comment", 
      "link": "https://www.facebook.com/10154603665915195/posts/10154603509055195"
    }, 
    {
      "name": "Like", 
      "link": "https://www.facebook.com/10154603665915195/posts/10154603509055195"
    }
  ], 
  "privacy": {
    "value": ""
  }, 
  "type": "photo", 
  "status_type": "added_photos", 
  "object_id": "10154603506630195", 
  "application": {
    "name": "Facebook for iPhone", 
    "namespace": "fbiphone", 
    "id": "6628568379"
  }, 
  "created_time": "2014-09-07T10:40:03+0000", 
  "updated_time": "2014-09-07T10:40:03+0000", 
  "likes": {
    "data": [
      {
        "id": "711243852300920", 
        "name": "Megumi Yoshida Atobe"
      }, 
      {
        "id": "10152707756462594", 
        "name": "Emily Stokes-Rees"
      }, 
      {
        "id": "10152741507272044", 
        "name": "Lina Kumamaru Sato"
      }
    ], 
    "paging": {
      "cursors": {
        "after": "MTAxNTI3NDE1MDcyNzIwNDQ=", 
        "before": "NzExMjQzODUyMzAwOTIw"
      }
    }
  }
}

2 个答案:

答案 0 :(得分:3)

如果您使用的是FB Graph API,请在请求中询问full_picture字段:

FB.api('10153224297552834_10153268631032834?fields=full_picture', function (response) { 
    console.log(response.full_picture);
});

答案 1 :(得分:2)

尝试在请求中指定attachments字段。

/v2.2/<someId>/feed?fields=attachments

这将为您提供一个“附件”字段,其中包含一些媒体。你会发现高分辨率图像。