Re: ICQ interface?

From: Date: Sun, 18 Aug 2002 07:42:40 +0000
Subject: Re: ICQ interface?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-113123@lists.php.net to get a copy of this message
Sometimes the easiest solutions are the best!! <img src="http://web.icq.com/whitepages/online?icq=51362125&img=21"> Courtesy of the ICQ site :) Justin French on 18/08/02 5:06 PM, Justin French (justin@indent.com.au) wrote: > Has anyone built, or partially built an interface to ICQ? > > I'm not necessarily looking for full IM thru a web/PHP interface, but maybe > some small stuff, like finding out if a certain user is online? > > I did a google and found this on Zend.com, but can't get it working (it > returns "unknown" everytime, with any number): > > <? > 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, &$errstr, 30); > if(!$fp) > { > > echo "$errstr($errno)<br>\n"; > } > else > { > fputs($fp,"GET/scripts/online.dll?icq=$uin&img=5HTTP/1.0\n\n"); > $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("S3IѱèJ",$line)) > { > return 'disabled'; > } > } > } > fclose($fp); > } > return 'unknown'; > } > > /* -------- usage ---------- > include('icq_status.php'); > $uin=51362125; > echoget_status($uin); > ----------------------------*/ > ?> > > > ... and this, which spits out an error: > "Warning: > file("http://wwp.icq.com/scripts/online.dll?icq=&img=1") > - > Undefined error: 0 in /usr/local/apache/htdocs/hinge/viewmember.php on line > 13" > > <? > > $uin = "51362125"; > function ICQ_Status($uin) > { > $arr = > file("http://wwp.icq.com/scripts/online.dll?icq=$uin&img=1"); > $len = strlen($arr[1]); > if ($len == "") return "ICQ: <span style=\"color:#707070\">Local > Server</span>"; > if ($len == 96) return "ICQ: <span > style=\"color:#009000\">Online</span>"; > if ($len == 83) return "ICQ: <span > style=\"color:#b00000\">Offline</span>"; > if ($len == 1) return "ICQ: <span > style=\"color:#000080\">Disabled</span>"; > } > echo ICQ_Status($uin); > > ?> > > > My guess is that these both DID work at one point, but if ICQ keeps changing > their methods, then the scripts become redundant. > > > Any links / guidance would be great! > > > Justin French > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#113123) next »