how to show facebook friends status
facebook status api is still in beta, in one of previous posts hasin showed how to set status of users with their permission. now, let’s see how we can get our facebook friend’s status, in next step i will show a tricky way to get a random person’s status who is not your facebook friend.
first let’s see how we can show our friends status. these following lines of code will return us an array
include_once("config.php");
//i'm using my own id
$user_status= $facebook->api_client->fql_query("SELECT status FROM user WHERE uid =579152077");
echo "<pre>";
print_r($user_status);
echo "</pre>";
//this will return an array like following
Array
(
[0] => Array
(
[status] => Array
(
[message] => is testing facebook status api.
[time] => 1234464510
[status_id] => 53699066735
)
)
)
so we can get any of our facebook friends’ status like this. If no status messages are found, the method returns an empty status_get_response element. now, the thing is, we can check our friends status from “live feed” tab on our home page right? so this status api could be interesting if we can show random friend’s status eh? unfortunately, this current beta API doesn’t support to get any random friends status but for the time being there is a possible way to get status of a person who is not our facebook friends BUT if he/she has at least 1 mutual friend. so let’s find a least possible way to get a random friend’s status who is NOT our friend on facebook but has a mutual friend. don’t worry, you don’t have to know his or her id
let’s have a look at following code.
include_once("config.php");
//get id by the random person's full name
$user_details = $facebook->api_client->fql_query("SELECT uid FROM user WHERE name = 'your_random_friend_full_name'");
//if this full name is unique and has a mutual friend with you, you can get his/her id like this...
$user_details[0]['uid'];
//now let's find out the status of that person
$status_array= $facebook->api_client->fql_query("SELECT status FROM user WHERE uid = {$user_details[0]['uid']}");
//now, simply it will return an array with status message like before.
I know this is not the right way to get status. i strongly believe facebook should open this status access to random friends with email id or full name – only then we can expect lot’s of cool application on facebook based on this status api.
15 Responses to “how to show facebook friends status”
Leave a Reply



























Raquibul Islam on February 13th, 2009
nice . thanks for share
rc29 on February 13th, 2009
hi, there’s also an easy way to show the status of a user:
<fb:user-status uid=”" linked=”true”/>
Bye
rc29 on February 13th, 2009
ay! i can’t write php code in comments…
rc29 on February 13th, 2009
hey ! that sucks ! how can i do to write proper code in the comments ?
so………. to show the status of user:
(@Junal: sorry for triple post !
)
peter on February 25th, 2009
BTW, thanks in advance for any help
Nidhi vats on May 21st, 2009
this site is very useful site
mansukh mangukiya on June 27th, 2009
facebook is useful to find a good friends.
mansukh mangukiya on June 27th, 2009
facebook is useful to find a good friend.
VAISHNAVI on August 2nd, 2009
HAPPY FRIENDSHIP DAY
blogbiss on September 7th, 2009
nice post, it needs permission from our friends
Loxdrocrics on January 8th, 2010
comment3, ambien and depression, 3776, levaquin and prednisone, 7393, synthroid weight loss, admit, prednisone lymphoma, 8-), bactrim diarrhea, listening, ritalin and prozac, 7027, xanax mexico, 7783, lasix furosemide, X-D, valium intra rectal, snatch, nolvadex tablets, 9459
EroriaEfferne on March 31st, 2010
comment5, nolvadex supplement, <|-), can u snort hydrocodone, :-C, sweet valium high, 3644, buy levitra uk, 550, codeine 3, <|-), how long does diflucan work, X-D, hydrocodone apap 5mg 500mg, :-] 500 mg vicodin, 2583, letrozole and nolvadex, :’-D, viagra canadian pharmacy, %0
QueelaSuiltew on April 7th, 2010
comment5, how long hydrocodone stays in your system, dignified, phentermine 37.5, method, xanax or ativan, marl, phentermine fastin, 4055, how long does diflucan take to cure a yeast infection, armament, zithromax purchase, 8436, lasix 30 mg, 9179, generic levitra canada, 1097, oxycodone vs morphine, 6459, viagra dublin, :-
DefZelilijild on April 20th, 2010
comment4, propecia side effects forum, diminished, cheap vicodin, 571, next day viagra, regrets, buy viagra cialis, 4026, phentermine mexico, thong, how much cialis, X-D, women and viagra, wrestling, generic viagra uk, 9914, viagra prescription cost, 7076, valium 2, :-]
Ceargeast on May 27th, 2010
comment2, zithromax dose, 9222, low dose prednisone, 7305, viagra generic online, derived, buy ambien cr, 2994, levitra medication, capture, antibiotic zithromax, startlingly, pfizer viagra online, suited, cialis in holland, militia, viagra for men, spat, viagra low cost, heartily