Reputation: 1095
HI,
I am using face api to fetch friend list.Please see this code below:
require '../src/facebook.php';
$facebook = new Facebook(array(
'appId' => '170864786279481',
'secret' => 'cd4b835feb73c358eeb4c4df5c293a42',
'cookie' => true, // enable optional cookie support
));
$session = $facebook->getSession();
$friendsLists = $facebook->api('/me/friends/');
This code gives me all friends of user But I need friends for selected location only.For example I want to get only those friends who are living in city "New york" only.Is it possible in this facebook api.Please guide me.
Regards Deepak
Upvotes: 0
Views: 975
Reputation: 2613
You should use FQL's friend and user tables.
FQL Usage example:
$query = "SELECT ...";
$params = array(
'access_token' => $session['access_token'],
'query' => $query
);
$url = "https://api.facebook.com/method/fql.query?" . http_build_query($params);
$data = simplexml_load_file($url);
// do something with the response, you should catch errors too.
Upvotes: 1