2017-01-11 151 views
1

我正在使用Facebook Graph API在公共页面上发布帖子。对于每篇文章,我得到以下内容:获取“链接帖子”的照片/缩略图 - 图形API Facebook

{ 
    "message": "XXXXX", 
    "id": "104076318XXXX", 
    "created_time": "2017-01-11TXXXX", 
    "link": "http://bit.lXXXXX", 
    "type": "link", 
    "name": "XXXX", 
    "permalink_url": "https://www.facebook.comXXX", 
    "full_picture": "https://external.xx.fbcdn.net/safe_image.php?d=XXXX", 
    "picture": "https://external.xx.fbcdn.net/safe_image.php?d=AQBXXXX" 
} 

图片和full_picture网址返回1x1像素图像。这是正常的吗?如果是这样,我怎么能得到由Facebook生成的缩略图图片?

由于

PD:我使用的图形API的版本2.8

回答

0

50x50像素

<img src="https://graph.facebook.com/{{fid}}/picture">

200像素宽

<img src="https://graph.facebook.com/{{fid}}/picture?type=large">

型图像

  1. 广场:最大宽度和50个像素的高度。
  2. 小:最大宽度为50像素,最大高度为150像素。
  3. 正常:最大宽度为100像素,最大高度为300像素。
  4. 大:最大宽度为200像素,最大高度为600像素。

或者你可以使用HTML代码

<img src="https://graph.facebook.com/{{fid}}/picture?width=140&height=110"> 

例子

https://graph.facebook.com/351843608490742/picture?width=300&height=300

你可以看到更多的Facebook API - How do I get a Facebook user's profile image through the Facebook API (without requiring the user to "Allow" the application)

相关问题