I noticed when I visit photo printing websites, they ask you if you would like to import your photos from Facebook. How do they do it? Does Facebook provide API to import us
/**
* get_albums()
*
* @param long $uid
* @return array
*/
function get_albums($uid=null)
{
if (empty($uid))
$uid = $_REQUEST['fb_sig_user'];
try
{
return $facebook->api_client->photos_getAlbums($uid,null);
}
catch (FacebookRestClientException $ex)
{
return array();
}
}
/**
* get_photos()
*
* @param bool $bool_pids
* @param mixed $aids (array of album ids or null)
* @return array
*/
function get_photos($bool_pids=true, $aids=null, $pids=null)
{
try
{
$p = $facebook->api_client->photos_get(null, $aids, $pids);
}
catch (FacebookRestClientException $ex) { }
if ($bool_pids)
{
$pids = array();
if (!empty($p))
foreach($p as $p0)
$pids[] = $p0['pid'];
return $pids;
}
else
return $p;
}