0

I try in FQL to have latests photos of all my friends ordered by desc in one request but I have only photos of two friends in response to this query :

SELECT src_small ,owner,created FROM photo WHERE aid IN (
SELECT aid FROM album WHERE owner IN (
SELECT uid2 FROM friend WHERE uid1=me()
)
)ORDER BY created DESC

If I delete order by of my subquery , it's the same problem I have only photos of 5 friends

I have good permissions

It's very problematic for me , because i want to load the latest photos of the week ( include all friends and lists friends)

Do you have an idea or ever resolve this problem ?

Thanks very much for your help, I am totally stuck and disappointed

1 Answers1

1

The problem is that your are limited in how much data can be returned. FB limits you to around ~5K values. [ 5 friends with on average of 1,000 pics = 5K]. FQL has no method of paging for photos.

What you need to do is get each album, order by creation date, and limit that result depending on the amount of friends you have. (1K friends = 5 photos each)

You will notice from the code below (broken up into 3 parts for clarity ) that many albums are returned, as wanted, however too few pictures are bing returned from the 5. There is no simple FQL answer.

{
"query1":"SELECT uid2 FROM friend WHERE uid1=me()",
"query2":"SELECT aid,owner FROM album WHERE owner IN (SELECT uid2 FROM #query1)",
"query3":"SELECT src_small ,owner,created FROM photo WHERE aid IN (SELECT aid FROM #query2) ORDER BY created DESC"

}

Grzegorz Gierlik
  • 11,112
  • 4
  • 47
  • 55
  • Other things which could limit results are permissions (i.e. app permissions to data). Also some photos (i.e. covers) could not belong to any album `aid` is `0`. – Grzegorz Gierlik Jan 29 '13 at 10:51
  • this will work: http://stackoverflow.com/questions/12956181/getting-latest-photos-from-friends-not-working – jclova Apr 09 '13 at 19:04