Attention ICQ Users (User Status Script)

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

stscac

A Wealth of KnowledgeVIP Member
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:

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 :guilty:
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Why do you need a myuin and otheruin? And is it possible to make an online form such as "Enter a UIN and get its' status"?
 
0
Close
ok everyone, here is the requested, new and improved updated edition...

PHP:
<?php

if (isset($_POST['submit'])) {
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($icqnum);
} else {?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Is Your ICQ Friend Online? - Provided by STSCAC of NamePros (www.stscac.com)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="250" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><p><b>Are your ICQ friends Online?</b></p>
      <form action="icq.php" method="post"><p>ICQ Number:<br>
        <input type="text" name="icqnum">
  <input type="hidden" name="submit">
        <input type="submit" name="Submit" value="Submit"></form>
    </td>
  </tr>
</table>
</body>
</html>
<?}?>

Features support as a form (as requested).

Any additional mods can be done by me. As always, rep is always appreciated.

Enjoy!

-Steve
 
Last edited:
0
Close
Awesome!!! I used to be in the UIN speculation business untill I found domains more profitable ;)
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Filters for activity feeds
Your news feed, Latest activity, and the activity tab on profiles now have filter buttons: All, Posts, Quick replies, and Other. Your...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back