Posted By

dubogii on 06/08/11


Tagged

list api graph facebook Friend


Versions (?)

How to retrieve facebook user’s friendlist


 / Published in: PHP
 

URL: http://thinkdiff.net/facebook/how-to-retrieve-facebook-users-friendlist/

  1. Using graph api:
  2. function getUserFriendList($facebook){
  3. $friends = $facebook->api('/me/friends');
  4. return $friends;
  5. }
  6.  
  7.  
  8.  
  9. Using legacy api:
  10. function getUserFriendList($facebook, $uid){
  11. try {
  12. $param = array(
  13. 'method' => 'friends.get',
  14. 'uid' => $uid,
  15. 'flid' => '',
  16. 'callback'=> ''
  17. );
  18. $friends = $facebook->api($param);
  19. return $friends;
  20. }
  21. catch(Exception $o) {
  22. d($o);
  23. }
  24. return '';
  25. }

Report this snippet  

You need to login to post a comment.