0

I am trying to sort my friends by the number of mutual friends we have. I tried getting the number of mutual friends one by one and creating an id->no_of_mutual_friend key value pair but that just takes way too long, because I have to call the facebook API over a 1000 times.

Is there an easier way to do this by using FQL?

Bart
  • 19,692
  • 7
  • 68
  • 77
s_curry_s
  • 3,332
  • 9
  • 32
  • 47

1 Answers1

3

This do what you need?

SELECT uid, mutual_friend_count
FROM user
WHERE uid IN 
    (SELECT uid1 
     FROM friend 
     WHERE uid2 = me()) 
ORDER BY mutual_friend_count DESC
Mark Amery
  • 143,130
  • 81
  • 406
  • 459