Is it still possible to get Skype's user online status?
Asked Answered
B

3

14

As the title says, is it still possible to check a user's status (online, offline, busy...) on Skype after the (big) change in its API service? Developers section seems very very limited now: http://developer.skype.com/

Bathometer answered 23/2, 2014 at 13:19 Comment(0)
M
5

Yes there is.

There are some urls wich can be used to detect the online status.

This gives a text with the statusname (e.g. away or online)

http://mystatus.skype.com/SKYPENAME.txt

This gives you a numeric skype statuscode (see list below)

http://mystatus.skype.com/SKYPENAME.num

This gives an xml output including numeric statuscode and statustext in diffent languages

http://mystatus.skype.com/SKYPENAME.xml

At last you have urls which show diffent status icon images:

Replace "smallicon" or "smallclassic" with the image you like. (Possible values: balloon, bigclassic, smallclassic, smallicon, mediumicon, dropdown-white, dropdown-trans)

http://mystatus.skype.com/smallicon/SKYPENAME http://mystatus.skype.com/smallclassic/SKYPENAME http://mystatus.skype.com/SKYPENAME

In PHP The best way is to use my function:

  /**
   * @version: 1.0 (2014-05-13
   *
   * @param: String $username             Skype Username
   * @param: [String $lang]               Languagecode (possible values 2014-05-13: "en", "fr", "de","ja", "zh-cn", "zh-tw", "pt", "pt-br", "it", "es", "pl" , "pl"
   * @param: [String $img_time]           Typ im Status Image wich you like to show (Possible values: 2014-05-13: balloon, bigclassic, smallclassic, smallicon, mediumicon, dropdown-white, dropdown-trans)
   *
   * @return array                        "num" = Skype Statuscode, "text" = Statustext (Away" ect.), "img_url" url to Statuscode Image
   */
  function getSkypeStatus($username, $lang = "de", $img_type = "mediumicon")
  {
    $url = "http://mystatus.skype.com/".$username.".xml";
    $data = @file_get_contents($url);

    $status = array();
    if($data === false)
    {
      $status = array("num" =>0,
                      "text"=>"http error"
                );
      if(isset($http_response_header)) $status["error_info"] = $http_response_header;
    }
    else
    {
      $pattern = '/xml:lang="NUM">(.*)</';
      preg_match($pattern,$data, $match);

      $status["num"] = $match[1];

      $pattern = '/xml:lang="' . $lang .'">(.*)</';
      preg_match($pattern,$data, $match);

      $status["text"]    = $match[1];
      $status["img_url"] = "http://mystatus.skype.com/".$img_type."/".$username;
    }
    return $status;
  }

Usage:

$status = getSkypeStatus("YourSkypeName"); // Minimal
$status = getSkypeStatus("YourSkypeName","de");  // with defined language for Statustext
$status = getSkypeStatus("YourSkypeName","de", "mediumicon"); // with specified image 

// to display status Icon:

echo '<img src="'.$status["img_url"].'" alt="'.$status["text"].'" title="'.$status["text"].'">';


// or if you like to do you own code for different status

switch($status["num"])
{
  case 7:
  case 2: echo "You are online"; break;
  default: echo "you are offline or in away state";
}

Possible Status messages (in english) are

  • http error: Error to get the api data e.g. problems with internet
  • connection Unknown: Not opted in or no data available. Offline:
  • The user is Offline Online: The user is Online Away:
  • The user is Away Not Available: The user is Not Available Do Not
  • Disturb: The user is Do Not Disturb (DND)
  • Invisible: The user is Invisible or appears Offline
  • Skype Me: The user is in Skype Me mode

Possible numeric Statuscodes:

  • case 0 = Unknown
  • case 1 = Offline
  • case 2 = Online
  • case 3 = Away
  • case 4 = Not Available
  • case 5 = Do Not Disturb
  • case 6 = Invisible
  • case 7 = Skype Me

I god these informations from following threads: https://mcmap.net/q/829850/-instant-messenger-online-status-check-indicator-for-gtalk-msn-skype-facetime-or-messages-closed https://mcmap.net/q/829851/-how-to-integrate-live-skype-status-in-my-application

Metamathematics answered 20/5, 2014 at 5:44 Comment(5)
What if I have a dot in my username?Katzman
It should also work if your name includes a dot. If not try the function from Boann here: https://mcmap.net/q/829852/-encode-the-url-including-hyphen-and-dot-in-php it should replace everything with the html % code.Metamathematics
mystatus.skype.com/smallicon/<skype login> link not works: <html><body><b>Http/1.1 Service Unavailable</b></body> </html>Gentilism
Hmm ... maybe microsoft changed this api too after they bought skype :(Metamathematics
Those URLs don't appear to work anymore for me... DNS error I believe.Faruq
M
9

UPDATE 2014-12-19:

It is important to know: checking a skype status works ONLY if the user has enabled "my status in internet" or "Mein Status darf im Netz veröffentlicht werden" (in german). Otherwise the status is alway "offline"

Metamathematics answered 19/12, 2014 at 7:29 Comment(0)
R
6

Feature is not supported since May 2015

The checkbox disappeared from Skype Options.

Source: https://support.skype.com/en/faq/FA605/how-do-i-set-up-the-skype-button-to-show-my-status-on-the-web-in-skype-for-windows-desktop

Regan answered 10/9, 2015 at 17:49 Comment(0)
M
5

Yes there is.

There are some urls wich can be used to detect the online status.

This gives a text with the statusname (e.g. away or online)

http://mystatus.skype.com/SKYPENAME.txt

This gives you a numeric skype statuscode (see list below)

http://mystatus.skype.com/SKYPENAME.num

This gives an xml output including numeric statuscode and statustext in diffent languages

http://mystatus.skype.com/SKYPENAME.xml

At last you have urls which show diffent status icon images:

Replace "smallicon" or "smallclassic" with the image you like. (Possible values: balloon, bigclassic, smallclassic, smallicon, mediumicon, dropdown-white, dropdown-trans)

http://mystatus.skype.com/smallicon/SKYPENAME http://mystatus.skype.com/smallclassic/SKYPENAME http://mystatus.skype.com/SKYPENAME

In PHP The best way is to use my function:

  /**
   * @version: 1.0 (2014-05-13
   *
   * @param: String $username             Skype Username
   * @param: [String $lang]               Languagecode (possible values 2014-05-13: "en", "fr", "de","ja", "zh-cn", "zh-tw", "pt", "pt-br", "it", "es", "pl" , "pl"
   * @param: [String $img_time]           Typ im Status Image wich you like to show (Possible values: 2014-05-13: balloon, bigclassic, smallclassic, smallicon, mediumicon, dropdown-white, dropdown-trans)
   *
   * @return array                        "num" = Skype Statuscode, "text" = Statustext (Away" ect.), "img_url" url to Statuscode Image
   */
  function getSkypeStatus($username, $lang = "de", $img_type = "mediumicon")
  {
    $url = "http://mystatus.skype.com/".$username.".xml";
    $data = @file_get_contents($url);

    $status = array();
    if($data === false)
    {
      $status = array("num" =>0,
                      "text"=>"http error"
                );
      if(isset($http_response_header)) $status["error_info"] = $http_response_header;
    }
    else
    {
      $pattern = '/xml:lang="NUM">(.*)</';
      preg_match($pattern,$data, $match);

      $status["num"] = $match[1];

      $pattern = '/xml:lang="' . $lang .'">(.*)</';
      preg_match($pattern,$data, $match);

      $status["text"]    = $match[1];
      $status["img_url"] = "http://mystatus.skype.com/".$img_type."/".$username;
    }
    return $status;
  }

Usage:

$status = getSkypeStatus("YourSkypeName"); // Minimal
$status = getSkypeStatus("YourSkypeName","de");  // with defined language for Statustext
$status = getSkypeStatus("YourSkypeName","de", "mediumicon"); // with specified image 

// to display status Icon:

echo '<img src="'.$status["img_url"].'" alt="'.$status["text"].'" title="'.$status["text"].'">';


// or if you like to do you own code for different status

switch($status["num"])
{
  case 7:
  case 2: echo "You are online"; break;
  default: echo "you are offline or in away state";
}

Possible Status messages (in english) are

  • http error: Error to get the api data e.g. problems with internet
  • connection Unknown: Not opted in or no data available. Offline:
  • The user is Offline Online: The user is Online Away:
  • The user is Away Not Available: The user is Not Available Do Not
  • Disturb: The user is Do Not Disturb (DND)
  • Invisible: The user is Invisible or appears Offline
  • Skype Me: The user is in Skype Me mode

Possible numeric Statuscodes:

  • case 0 = Unknown
  • case 1 = Offline
  • case 2 = Online
  • case 3 = Away
  • case 4 = Not Available
  • case 5 = Do Not Disturb
  • case 6 = Invisible
  • case 7 = Skype Me

I god these informations from following threads: https://mcmap.net/q/829850/-instant-messenger-online-status-check-indicator-for-gtalk-msn-skype-facetime-or-messages-closed https://mcmap.net/q/829851/-how-to-integrate-live-skype-status-in-my-application

Metamathematics answered 20/5, 2014 at 5:44 Comment(5)
What if I have a dot in my username?Katzman
It should also work if your name includes a dot. If not try the function from Boann here: https://mcmap.net/q/829852/-encode-the-url-including-hyphen-and-dot-in-php it should replace everything with the html % code.Metamathematics
mystatus.skype.com/smallicon/<skype login> link not works: <html><body><b>Http/1.1 Service Unavailable</b></body> </html>Gentilism
Hmm ... maybe microsoft changed this api too after they bought skype :(Metamathematics
Those URLs don't appear to work anymore for me... DNS error I believe.Faruq

© 2022 - 2024 — McMap. All rights reserved.