So I'm trying to grab the graph feed of a (public) Fb page album in PHP, convert the JSON feed to html and output. I found this URL that seems to get me part way:
I appreciate that there's a limit of 100 images, which is fine. What I'm struggling with is the access key. I understand that this is needed (although I can get the JSON of any public page album without it - not sure how that works). So:
I've read a good number of items in S.O. about this but some seem out of date now when I follow the steps, others lost me part way through, some are a little advanced for my newbie skills, but help would be appreciated. Apologies if I sound like I'm getting confused here, but ... I am.
You can use this method below.
id=FACEBOOK USER ID & PHOTO ALBUL ID
$query = "SELECT aid,object_id,name,size,type FROM album WHERE owner = '$id' ORDER BY modified DESC";}
$url = 'https://graph.facebook.com/fql?q='.rawurlencode($query).'&format=json-strings';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$return_data = curl_exec($ch);
$json_array = json_decode($return_data,true);
return $json_array;
Looks like no-one had an answer here but I've found a good solution here: http://kevinp93.com/facebook-images-on-website-v2/ and it turns out that I just had the wrong order to the access token in the URL - it had to be at the end or it classed the rest of the URL as part of the token.