The given PHP example returns the current Yahoo status(online/offline) against a yahoo userid.
<?php| functionyahoo($id){ | 
|     $url= 'http://opi.yahoo.com/online?u='; | 
|     $data= file_get_contents($url. $id); | 
|     if(trim(strtolower(strip_tags($data))) != 'user not specified.') { | 
|         return(strlen($data) == 140) ? 'online': 'offline'; | 
|     } else{ | 
|     returntrim(strip_tags($data)); | 
|     } | 
|     }  | 
| echoyahoo("yahoo_userid"); | 
?>
No comments:
Post a Comment