This article is a method of implementing QQ online query function by ASP shared by the editor of Foxin Technology Channel. In fact, this function can be used freely in other projects. I hope it will be helpful for everyone to learn this knowledge!
The specific content is as follows:
The method of this program is to use XMLHTTP to read the corresponding HTML code of Tencent website to obtain the QQ avatar. According to this idea, we can also crawl a lot of information from other websites, such as weather forecasts, news, etc.
<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+QQcode+"">><img src=""+RegExp.$1+"" width=16 height=16 border=0></a>"; http=null; } document.write("My QQ status: "+getFaceImg("44723461")); //--> </script>The above is the method of ASP implementing QQ online query function described in this article. I hope you like it and I hope you will continue to support the wrong new technology channel!