Zend - The PHP Company




HTTP

Add Code


ICQ Status Checker  

Type: code fragment
Added by: billzeller
Entered: 13/07/2000
Last modified: 08/12/1999
Rating: **** (8 votes)
Views: 18499
The function get_status($uin) checks the icq status of of the uin "$uin". The possible "returns" are online, offline, disabled, and unknown.

Please report any bugs, comments, or ideas on how to improve this script to me.

A similiar script is available here.


<?
function get_status($uin){
 
/*************************************
  * Copyright � 2000 Scriptmakers.com *
  * Feel free to edit, modify and     *
  * redistribute as long as this      *
  * message is kept intact.           *
  *************************************/
 
$fp fsockopen ("wwp.icq.com"80, &$errno, &$errstr30);
 if(!
$fp){
  echo 
"$errstr ($errno)<br>n";
 }else{
  
fputs($fp"GET /scripts/online.dll?icq=$uin&img=5 HTTP/1.0nn");
  
$do 'no';
  while(!
feof($fp)) {
   
$line fgets ($fp,128);
   
$do = ($do == 'yes')?'yes':(eregi("^GIF89"$line))?'yes':'no';;
   if(
$do == 'yes'){
     if(
ereg("�7@ �40"$line)){
      return 
'online';
     }elseif(
ereg("�w` �40"$line)){
      return 
'offline';
     }elseif(
ereg("S�Iѱ�J"$line)){
      return 
'disabled';
     }
   }
  }
  
fclose($fp);
 }
 return 
'unknown';
}
?>


Usage Example


<?
include('<file_with_function>.php');

$uin 41283698;
echo 
get_status($uin);
?>


Rate This Script





Search



This Category All Categories