I tried getting the latest photos fo my friends using a method described here: FQL - Can i get photos of my friends posted this week
At first it seemed to be working fine but then I noticed that some of the photos of my friends weren't being fetched even though they had a higher timestamp (the photos were being sorted by created field from photo FQL table)... After a bit of debugging I noticed that the problem is in
SELECT aid FROM album WHERE owner IN
(SELECT uid2 FROM friend WHERE uid1=me()
if I pass a short list of my friends' IDs they are being sorted correctly, but when I pass a complete list not all friends are included in the query result...
Any ideas why this isn't working? Are there any limits on how many values can be passed in a "SELECT XXX FROM YYY WHERE ZZZ IN (?)" query?
Thanks in advance for any advice
The limit seems to be about 5000 records returned in any part of an FQL query.
Assuming you have fewer than 5000 friends, you could cut down on the number of albums returned by modifying your query to inspect the
modified_major
column to only return albums that have had a photo added in the period of interest. You could alternately look at themodified
column to return any album modifications.Also, it looks like
aid
andpid
are on the path to deprecation. New development should useobject_id
for maximum compatibility.So to get all albums that have had a photo updated since 2012-10-01, you could use this query:
In your outter query change
aid
toalbum_object_id
andpid
toobject_id