- Impact
- 73
Hello Again Fellow NamePros Members!
Just wanted to share my modification of something I found online, an ICQ status indicator. You can put this on your site, to let your users know if you are available to chat through ICQ.
The code is below:
If you appreciate my contribution, please post rep, donate NP$, or both
More stuff on the Way, only from stscac
-Steve
Just wanted to share my modification of something I found online, an ICQ status indicator. You can put this on your site, to let your users know if you are available to chat through ICQ.
The code is below:
PHP:
<?php
$myuin = "197829943";
$otheruin = "22554411";
function GetICQ($uin) {
if (!is_numeric($uin)) return FALSE;
$fp = fsockopen('status.icq.com', 80, &$errno, &$errstr, 8);
if (!$fp) {
return "N/A";
}
else {
$request = "HEAD /online.gif?icq=$uin HTTP/1.0\r\n"
."Host: web.icq.com\r\n"
."Connection: close\r\n\r\n";
fputs($fp, $request);
do {
$response = fgets($fp, 1024);
}
while (!feof($fp) && !stristr($response, 'Location'));
fclose($fp);
if (strstr($response, 'online1')) return 'Online';
if (strstr($response, 'online0')) return 'Offline';
if (strstr($response, 'online2')) return 'N/A';
// N/A means, this User set the Option, his Online
// Status cannot be shown over the Internet
return FALSE;
}
}
echo GetICQ($myuin);
echo GetICQ($otheruin);
?>
If you appreciate my contribution, please post rep, donate NP$, or both
More stuff on the Way, only from stscac
-Steve







