I do not know if you are familiar with the msxml2.xmlhttp, but its function can be said to have reached the pole. You can through it to the other people's website "moved back", hehe, bragging!!
Today I use it from the Tencent website to get a QQ number of the head, online situation (I have no way to be invisible). Of course, we can also get QQ nickname, location, etc. the implementation method is as follows:
First, two functions are created to handle a URL
Copy Code code as follows:
<%
function gethttppage (URL)
Dim http
Set Http=createobject ("MSXML2. XMLHTTP ")
Http.open "Get", Url,false
Http.send ()
If Http.readystate<>4 Then
Exit function
End If
Gethttppage=bytes2bstr (Http.responsebody)
Set http=nothing
If Err.number<>0 then err. Clear
End Function
"'" ' the following processing characters
Function Bytes2bstr (vIn)
Dim Strreturn
Dim I,thischarcode,nextcharcode
Strreturn = ""
For i = 1 to LenB (vIn)
Thischarcode = AscB (MidB (vin,i,1))
If Thischarcode < &h80 Then
Strreturn = Strreturn & Chr (Thischarcode)
Else
Nextcharcode = AscB (MidB (vin,i+1,1))
Strreturn = Strreturn & Chr (CLng (thischarcode) * &h100 + CInt (nextcharcode))
i = i + 1
End If
Next
Bytes2bstr = Strreturn
End Function
%>
These two functions you can collect, very useful.
We can take a look at this address first http://friend.qq.com/cgi-bin/friend/oicq_find?oicq_no=5292816
(QQ is my, I am very busy every day, please everyone consciously, hehe, discuss the question very welcome)
Here we will get information through Tencent's Buddy lookup,
<%
function Qqhead (QQ)
Url= "http://friend.qq.com/cgi-bin/friend/oicq_find?oicq_no=" &qq
Content=gethttppage (URL)
If Len (content) >6360 then ' if QQ is not valid, do some processing to avoid error occurrence.
Content=replace (content,instr (content, "http://img.tencent.com"), 38, "" "," ")
qqhead= "<a href= ' http://friend.qq.com/cgi-bin/friend/user_show_info?ln=" &qq& "' target= ' _blank ' > </a> '
Else
Qqhead= ""
End If
End Function
' OK, it's done. Now all you have to do is call.
Response.Write Qqhead (5292816)
If the QQ avatar is colored, the explanation friend is online, the gray is not online.
%>
We can go to http://www.okwest.net/books to see the effect. hehe.