Tuesday, July 14, 2009

PHP code to check whether a yahoo user is online or not

Hi

Do you want to check whether a yahoo user is avoiding you by setting his status to invisible mode. Please try this code..

< ? php //-------> No spaces in between
$id="sujith.sasi";
$url = 'http://opi.yahoo.com/online?u=';
$data = file_get_contents($url . $id);
if (trim(strtolower(strip_tags($data))) != 'user not specified.') {
echo (strlen($data) == 140) ? 'online' : 'offline'; }
else {
echo trim(strip_tags($data));
} ?>


cheers........ :-) [Remember to remove the spaces b/w the php "
< ? php " tag]

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails