漂亮的论坛虚拟形象
无需下载,打开网页就能玩的宠物网游
完全模仿真实的股市系统,满足你风险投资的欲望
黑道生涯,可以抢劫其他会员的钱和银行。。。
大侠闯荡江湖,很好玩的游戏
打工赚钱,赚钱论坛贡献
在论坛寻找红颜、蓝颜知己
依旧花店,送给论坛MM的好东西

查看完整版本: 精彩:用asp实现qq在线查询

只为搜索 2007-11-20 20:39

精彩:用asp实现qq在线查询

这段程序的方法是利用xmlhttp来读取腾讯网站的相应html代码获取qq的头像,根据这个想法,我们还可以抓取很多其他网站的信息,如天气预报、新闻等等。

  <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>
页: [1]
查看完整版本: 精彩:用asp实现qq在线查询