<%
Response.Expires =-1
Response.AddHeader "Cache-control", "No-cache"
Response.AddHeader "Pragma", "No-cache"
Wd=request ("D")
Sogouurl= "http://www.sogou.com/web?query=" &wd
Tempstr= Gethttppage (Sogouurl)
Dim sogouwebsite
Set Reg=new Regexp
Reg. Multiline=true
Reg. Global=flase
Reg. Ignorecase=true
Reg. pattern= "Sogou Rating: ((. | N) *?) /100 "
Set matches = Reg.execute (TEMPSTR)
For each match1 in matches
Sogouwebsite=match1. Value
Next
Set matches = Nothing
Set reg = Nothing
Sogouwebsite=replace (Sogouwebsite, "Sogou Rating:", "")
Sogouwebsite=replace (Sogouwebsite, "/100", "")
Sogouwebsite=replace (Sogouwebsite, ",", "")
If sogouwebsite= "" Then
Response.Write "document.write (" "<div class=pr><dd><span>
Src= ' images/sogoupr.gif ' width= ' 0% ' height=7/></span><a
href= ' http://www.sogou.com/web?query= ' &wd& ' Rel=nofollow Target=_blank
title= ' Sogou rank:0 ' class=prlink>0</a></dd></div> "");
Else
Response.Write ("Document.Write" ("<div class=pr><dd><span>
Src= ' images/sogoupr.gif ' width= ' "&SoGouWebSite&"% ' height=7/></span><a
href= ' http://www.sogou.com/web?query= ' &wd& ' Target=_blank title= ' Sogou Rank:
"&SoGouWebSite&" > "&SoGouWebSite&" </a></dd></div> "");
End If
Function Gethttppage (Path)
t = GetBody (Path)
Gethttppage=bytestobstr (T, "gb2312")
End Function
Function getbody (URL)
On Error Resume Next
& nbsp; Set retrieval = CreateObject ("Microsoft.XMLHTTP")
with retrieval
. Open "Get", url, False, "", "
. Send
getbody =. Responsebody
End With
Set retrieval = Nothing
End Function
Function bytestobstr (body,cset)
Dim objstream
Set objstream = Server.CreateObject ("ADO" & "Db.str" & "Eam")
objstream. Type = 1
objstream. Mode =3
objstream. Open
objstream. Write body
objstream. Position = 0
objstream. Type = 2
objstream. Charset = Cset
bytestobstr = objstream. ReadText
objstream. Close
Set objstream = no
end Function
%>