facebook birthday api
Posted by mahmud ahsan on October 25, 2009
Facebook, Facebook connect
There are many birthday related facebook application. Most of this type application provide feature like, they show you the upcoming birthdays of your friends. Some of the app also send notification to user before any birthday of his friends come.
Now I’ll show you the solution to get birthday of your friends using fql query or facebook api
Solution 1:
First you have to collect the uids (friends uid) of user and then get their info by api
$friends = $_REQUEST['fb_sig_friends'];
$userDetails = $facebook->api_client->users_getInfo($friends, 'last_name, first_name, uid, birthday');
foreach($userDetails as $user){
$birthday = $user['birthday']
}
You can also use FQL Query to retrieve such information:
Solution 2:
$friends = $_REQUEST['fb_sig_friends'];
$query = "SELECT uid, first_name, last_name, birthday FROM user WHERE uid IN ($friends) ORDER BY birthday_date;
$userDetails = $facebook->api_client->fql_query($query);
foreach($userDetails as $user){
$birthday = $user['birthday']
}
So, you can use any solution for your purpose. But remember, if any user don’t want to show his birthday to others using privacy options, then you never retrieve such user’s birthday.
Related Posts
Comments (1)







good share