加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_丽江站长网 (http://www.0888zz.com/)- 科技、建站、数据工具、云上网络、机器学习!
当前位置: 首页 > 服务器 > 搭建环境 > Windows > 正文

api – 还有可能让Skype的用户在线状态?

发布时间:2021-03-13 22:03:08 所属栏目:Windows 来源:网络整理
导读:正如标题所示,在API服务((大))更改后,是否仍可以在Skype上检查用户的状态(在线,离线,忙碌…)开发人员现在似乎非常有限: http://developer.skype.com/ 就在这里. 有一些网址可以用来检测在线状态. This gives a text with the statusname (e.g. away or on

正如标题所示,在API服务((大))更改后,是否仍可以在Skype上检查用户的状态(在线,离线,忙碌…)开发人员现在似乎非常有限: http://developer.skype.com/ 就在这里.

有一些网址可以用来检测在线状态.

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

在PHP最好的方法是使用我的功能:

/**
   * @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,mediumicon,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,$match);

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

用法:

$status = getSkypeStatus("YourSkypeName"); // Minimal
$status = getSkypeStatus("YourSkypeName","de");  // with defined language for Statustext
$status = getSkypeStatus("YourSkypeName","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";
}

可能的状态消息(英文)是

> http错误:获取api数据的错误,例如互联网问题
>连接未知:未选择或不可用数据.离线:
>用户在线离线:用户在线:
>用户离开不可用:用户不可用不
>打扰:用户是免打扰(DND)
>隐形:用户不可见或显示为离线
> Skype Me:用户在Skype Me中
模式

可能的数字状态码:

> case 0 =未知
> case 1 =离线
>案例2 =在线
>案例3 =离开
>案例4 =不可用
>案例5 =请勿打扰
>案例6 =隐形
> case 7 = Skype我

我上帝这些信息从以下线程:
https://stackoverflow.com/a/16320950/2377961
https://stackoverflow.com/a/6426418/2377961

(编辑:应用网_丽江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读