Friday, July 3, 2015

Php Script to Download Your Facebook Albums

In facebook there is no option to download all the albums that you have created. Following steps will describe how you can use a php script to download all the albums to your local machine.

I have used facebook access token to authenticate and facebook graph API to retrieve album details.

1. You can get the script from following git-hub repository.
https://github.com/yasithacp/fb-albums-download-script

2. Then you need to get your facebook access token.
  • Go to the facebook graph explorer.
  • Log in using your facebook credentials.
  • Click on the Get Token drop down and then Get Access Token.
  • Select check-box and click on Get Access Token.
  • Note down your access token.

3. Open up the script file and modify the following configuration section.
  • ACCESS_KEY: Access key retrieved in step 2.
  • FOLDER_PATH: Local folder path that albums should download.
4. Obviously you should have php on your machine.

5. Execute the following command to run the script and download will start.
6. If you have large number of albums, script will take time to download all the albums. If your access token get expired repeat the step 1 and replace the script with your new access token and re-run the script. Download will resume.