Facebook API 显示来自页面帖子的全尺寸图像


Facebook API displaying full size image from a page post?

我正在使用Facebook API将帖子拉入我的网站,目前我无法从帖子中检索全尺寸图像,只能检索缩略图。对于视频帖子,我得到了一个漂亮的大图像,但带有图像的帖子仅显示缩略图。

下面是一个示例响应:

[message] => She still likes to come home
                    [picture] => https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xfp1/v/t1.0-9/s480x480/1509768_949952475034523_5777855144535809574_n.jpg?oh=296a9975752be40f24a0e32d613328aa&oe=54DCDB3A&__gda__=1426487880_adf80b362906423f8952c92925766989
                    [link] => https://www.facebook.com/photo.php?fbid=949952475034523&set=o.337363685362&type=1
                    [icon] => https://fbstatic-a.akamaihd.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif
                    [privacy] => stdClass Object
                        (
                            [value] => 
                        )
                    [type] => photo
                    [object_id] => 949952475034523
                    [application] => stdClass Object
                        (
                            [name] => Facebook for iPhone
                            [namespace] => fbiphone
                            [id] => 6628568379
                        )
                    [created_time] => 2014-11-25T18:43:41+0000
                    [updated_time] => 2014-11-25T18:43:41+0000

请注意,[picture]中的结果是一个小图像。

这是我正在使用的代码:

<?php
function fetchUrl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
$feedData = curl_exec($ch);
curl_close($ch); 
return $feedData;
}
$profile_id = "xxxxx";
//App Info, needed for Auth
$app_id = "xxxxxxxxxxx";
$app_secret = "xxxxxxxxxxxxxxxxxxxxxxxxx";
//Retrieve auth token
$authToken = fetchUrl("https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id={$app_id}&client_secret={$app_secret}");
$json_object = fetchUrl("https://graph.facebook.com/{$profile_id}/feed?{$authToken}");
$feedarray = json_decode($json_object);
print_r($feedarray);
?>
是否有

其他方法可以对其进行编码,以允许我检索全尺寸图像,或者是否有方法重组返回的 URL 以显示较大的图像?

谢谢。

找到了这篇旧帖子; 你一定已经想通了; 不过,答案是你重组你的网址以获得"附件":

https://graph.facebook.com/{$profile_id}/feed?access_token={$authToken}&fields=attachments

你会得到一个"src",它将有一个更大的图像。