1

I am new in Drupal, I want to get all the images from my Facebook account and want to display them into front end.

I tried Facebook Album Fetcher module but this module give me the facility to get images only for a particular album not for overall. I want to get and display only the latest uploaded images from my whole account (Images will be anywhere like profile images or timeline images or album images etc).

So can anyone please tell me, is there any module which can fill my above requirement? If not then how can i get all the latest uploaded images to display them into front end?

Please help.

Thanks in advance.

Mash
  • 420
  • 3
  • 5
  • 16

1 Answers1

1

Finally I resolved this issue by using Facebook API and page ID. Firstly I got the page id where all the images uploaded. To get the Facebook page id just go through the below two link:

https://graph.facebook.com/

https://graph.facebook.com/testpage.

Here is my code by which i got all the images for testpage page:

<?php 
include_once "facebook/facebook.php";
$facebook = new Facebook(array(
    'appId'     => 'YOUR_API',
    'secret'    => 'YOUR_API_SECRET',
    'cookie' => true
));
$accessToken = $facebook->getAccessToken();
$photoQuery = urlencode('SELECT pid,owner,src_small,src_big FROM photo WHERE aid IN (SELECT aid  FROM album  WHERE owner = "YOUR_PAGE_ID")');
$photoFQL = 'https://api.facebook.com/method/fql.query?query='.$photoQuery .'&access_token='.$accessToken.'&format=json';   
$photoResults = file_get_contents($photoFQL);
$photo12 = json_decode($photoResults);
foreach ($photo12 as $value) {
    echo '<img src="'. $value->src_big .'">';
}
?>
Mash
  • 420
  • 3
  • 5
  • 16