Skype - Online status

Skype includes an option to poll the online status from a username, and that is what I use for the online status display on the sidebar here. Since I want the plain text version (and not all caps like the one Skype offers), I used this code in a k2 php module:

PHP:
  1. $status = file_get_contents("http://mystatus.skype.com/lindsve.num");
  2. switch($status) {
  3.     case 0:
  4.         $message = "Unknown";
  5.         break;
  6.     case 1:
  7.       $message = "Offline";
  8.       break;
  9.     case 2:
  10.         $message = "Online";
  11.         break;
  12.     case 3:
  13.         $message = "Away";
  14.         break;
  15.     case 4:
  16.         $message = "Not Available";
  17.         break;
  18.     case 5:
  19.         $message = "Do Not Disturb";
  20.         break;
  21.     case 6:
  22.         $message = "Invisible";
  23.         break;
  24.     case 7:
  25.         $message = "Skype Me";
  26.         break;
  27. }
  28. echo "<p>$message</p>";


If you know of any easier way, please drop a line in the comments!

Technorati Tags: , ,

0 Responses to “Skype - Online status”


  1. No Comments

Leave a Reply