diff --git a/README.md b/README.md index a2a3bbd..75ecc97 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A simple demo of how to use the Facebook API with the JavaScript SDK to get all A full writeup can be found here https://websitebeaver.com/facebook-api-javascript-sdk-get-all-albums-and-photos, along with a [demo video](https://www.youtube.com/watch?v=s8kasi_8nIo). -## How to Use? +# How to Use? Firstly, you must get approved by [approved by Facebook](https://developers.facebook.com/docs/facebook-login/review/how-to-submit) to use `user_photos` permissions. @@ -19,4 +19,65 @@ FB.init({ xfbml : true, version : 'v3.0' }); -``` \ No newline at end of file +``` + +# Just Using the Functions + +I made this in demo form for anyone to quickly get things workings. But if you'd like to just use the functions, then all you need is **fb-code.js**. You can obviously also use it as a starting point and edit each function to suit your needs. As shown in the tutorial, this will all be stored in an object called `fbAlbumsPhotosObj`. Additionally it'll be the response of `winCallback` for each function. + + +```javascript +function getFbAlbums(int limitAlbums = 5, function winCallback(obj response), function failCallback(string error)) +``` + +**Description** + +Get Facebook albums + +**Parameters** + +- **int limitAlbums** - The amount of albums to fetch at once +- **function winCallback(obj response)** - On success +- **function failCallback(string error)** - On failure + +```javascript +function getFbPhotosInAlbum(int albumId, int limitPics = 10, function winCallback(obj response), function failCallback(string error)) +``` + +**Description** + +Get Facebook photos in an album + +**Parameters** + +- **int albumId** - The album id to get photos from +- **int limitAlbums** - The amount of photos to fetch at once +- **function winCallback(obj response)** - On success +- **function failCallback(string error)** - On failure + +```javascript +function getMoreFbAlbums(function winCallback(obj response), function failCallback(string error)) +``` + +**Description** + +Get Facebook more albums until depletion + +**Parameters** + +- **function winCallback(obj response)** - On success +- **function failCallback(string error)** - On failure + +```javascript +function getMoreFbPhotosInAlbum(albumId, function winCallback(obj response), function failCallback(string error)) +``` + +**Description** + +Get Facebook more photos in album until depletion + +**Parameters** + +- **int albumId** - The album id to get photos from +- **function winCallback(obj response)** - On success +- **function failCallback(string error)** - On failure