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]
$status = file_get_contents(“http://mystatus.skype.com/lindsve.num”);
switch($status) {
case 0:
$message = “Unknown”;
break;
case 1:
$message = “Offline”;
break;
case 2:
$message = “Online”;
break;
case 3:
$message = “Away”;
break;
case 4:
$message = “Not Available”;
break;
case 5:
$message = “Do Not Disturb”;
break;
case 6:
$message = “Invisible”;
break;
case 7:
$message = “Skype Me”;
break;
}
echo “

$message

“;
[/php]

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

[tags]skype, presence, web[/tags]

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>