In my previous post, I mentioned about a limitation while using facebook graph api to get photos where the user is tagged in. The problem was if the user is tagged in more than 25 photos, it will return only 25 photos. Now today when I tried with FQL, it is returning the complete list. So I have updated the code for ente facebook analysis with FQL code.
The FQL queries the photo table and the photo_tags table. By joining these 2 tables we will get the needed information. The query looks like this: select caption,src_small,src_big from photo where pid in (select pid from photo_tag where subject=’+id+’). This query is executed using FB.api() method.
FB.api(
{
method: 'fql.query',
query: 'select caption,src_small,src_big from photo where pid in (select pid from photo_tag where subject='+id+')'
},
function(response) {
$('#facebook-photos-tagged').html(response.length);
if(response.length==0)
{
$('.tagged-photos').html('No Photos Available');
}
$('.tagged-photos').html('');
for(var i=0;i<response.length;i++)
{
var desc='';
if(response[i].caption)
desc=response[i].caption;
$('.tagged-photos').append('<a href="'+response[i].src_big+'" title="'+desc+'" target="_blank"><img src="'+response[i].src_small+'" /></a>');
}
}
);



