ZiGGi

ICQ Image Status

May 17th, 2012
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.83 KB | None | 0 0
  1. <?php
  2.  
  3. $number = htmlentities(stripslashes($_GET['icq']), ENT_QUOTES, "UTF-8");
  4. $nicksize = strlen($number) * 15;
  5.  
  6. header("Content-type: image/png");
  7. $im = imagecreate($nicksize, 25);
  8. $background_color = imagecolorallocate($im, 255, 255, 255);
  9. $text_color = imagecolorallocate($im, 0, 0, 0);
  10.  
  11. $fp = fsockopen("status.icq.com", 80, $errno, $errstr, 30);
  12. if ($fp)
  13. {
  14.     fputs($fp, "GET /online.gif?icq=$number&img=5 HTTP/1.0\r\nHost: status.icq.com\r\n\r\n");
  15.     while (!feof($fp))
  16.     {
  17.         $str = fgets($fp,128);
  18.         if (($pos = strpos($str, "Location")) !== false)
  19.         {
  20.             $atim = imagecreatefromgif("http://status.icq.com/".substr($str, $pos + 10));
  21.             imagecopy($im, $atim, 0, 5, 0, 0, 16, 16);
  22.         }
  23.     }
  24.     fclose ($fp);
  25. }
  26.  
  27. imagettftext($im, 10, 0, 25, 18, $text_color, "fonts/Day.otf", $number);
  28.  
  29. imagepng($im);
  30. imagedestroy($im);
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment