Facebook Graph API - Finding a users top friends

后端 未结 6 1949
不思量自难忘°
不思量自难忘° 2020-12-13 03:08

I am writing a android app that will pull in a list of all the users friends so they can tag them in the photo but displaying a large box of the friends with their photo ins

6条回答
  •  一向
    一向 (楼主)
    2020-12-13 03:26

    I wanted to do this without requiring additional/extended permissions. I found a fairly decent approximation for my needs was the mutual_friend_count field in the user FQL table.

    So I used:

    $params = array('method' => 'fql.query',
                    'query' => 'SELECT uid, pic_square, name 
                     FROM user 
                     WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me()) 
                     ORDER BY mutual_friend_count DESC
    

    And then just fire that off using the PHP SDK

    $friend_array = $facebook->api($params);
    

提交回复
热议问题