当前位置:asp编程网>技术教程>Asp教程>  正文

使用ASP查询QQ在线状态功能的代码

2016-09-24 20:34:12   来源:网络    作者:佚名   浏览量:823   收藏

<script language="JavaScript">

  <!--

  function getFaceImg(QQcode)

  {

  var Re=new RegExp("^[1-9]{1}/d+$","g");

  if (!QQcode  !Re.test(QQcode)) return;

  var URL="http://search.tencent.com/cgi-bin/friend/oicq_find?oicq_no="+QQcode;

  var http=new ActiveXObject("Microsoft.XMLHTTP");

  http.open("GET",URL,false,"","");

  http.setRequestHeader("CONTENT-TYPE","text/html; Charset=gb2312");

  http.send();

  if (http.status!=200) return;

  var webStr=http.responseText;

  Re=new RegExp(""(http://img.tencent.com/face/[^"]+)"","ig");

  if (Re.test(webStr))

  return "<a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln="+QQcode+"" target=_blank title="QQ:"+QQcode+""><img src=""+RegExp.$1+"" width=16 height=16 border=0></a>";

  http=null;

  }

  document.write("我的QQ状态:"+getFaceImg("44723461"));

  //-->

  </script>


关于我们-广告合作-联系我们-积分规则-网站地图

Copyright(C)2013-2017版权所属asp编程网