I'm unsure if this is possible --
I'm developing an Android game, and I want it to include profile pictures of 15 random friends.
However, it seems my only option is to call the graph API "/me/friends" (several times, with paging) to get all of a users friends, store the list, then randomly select a subset of friends and retrieve their profile photos.
I was wondering if there's a single call to the Graph API to sort randomly, or somehow reduce the footprint of this job, so that I can use their server-side ?limit=15
to reduce the requests my app has to make.
Thanks!
This is possible via FQL query which you can run with Graph API
SELECT uid, name FROM user WHERE uid IN (
SELECT uid2 FROM friend WHERE uid1 = me()
) ORDER BY rand() limit 15
To get it via Graph API you just need to issue GET request to:
GET http://graph.facebook.com/fql?q={QUERY_HERE}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With