ASP Sogou Capture Program
<%
Response.Expires =-1
Response.AddHeader "Cache-control", "No-cache"
Response.AddHeader "Pragma", "No-cache"
Wd=request ("D")
If Request ("s") = "sogous" Then
Sogouurl= "Http://www.sogou.com/web?query=link%3A" &wd
Else
Sogouurl= "Http://www.sogou.com/web?query=site%3A" &wd
End If
Tempstr= Gethttppage (Sogouurl)
Dim sogouwebsite
Set Reg=new Regexp
Reg. Multiline=true
Reg. Global=flase
Reg. Ignorecase=true
Reg. Pattern= "<!--resultbarnum: (. | N) *?) --> "
Set matches = Reg.execute (TEMPSTR)
For each match1 in matches
Sogouwebsite=match1. Value
Next
Set matches = Nothing
Set reg = Nothing
Sogouwebsite=replace (Sogouwebsite, "<!--resultbarnum:", "")
Sogouwebsite=replace (Sogouwebsite, "-->", "")
Sogouwebsite=replace (Sogouwebsite, ",", "")
If sogouwebsite= "" Then
If Request ("s") = "sogous" Then
Response.Write ("document.write" "<a href= ' Http://www.sogou.com/web?query=link%3A" &wd& "' target= ' _ Blank ' title= ' data acquisition error, please requery later! & #10, lply Studio. COM ' ><font color= #999999 ><b>x</b></font></a> ");")
Else
Response.Write ("document.write" "<a href= ' Http://www.sogou.com/web?query=site%3A" &wd& "' target= ' _ Blank ' title= ' data acquisition error, please requery later! & #10, lply Studio. COM ' ><font color= #999999 ><b>x</b></font></a> ");")
End If
Else
If Request ("s") = "sogous" Then
Response.Write ("document.write" "<a href= ' Http://www.sogou.com/web?query=link%3A" &wd& "' target= ' _ Blank ' title= ' "&SoGouWebSite&" & #10; " &wd& "' Rel=nofollow class=ln>" &SoGouWebSite& "</a>"); "
Else
Response.Write ("document.write" "<a href= ' Http://www.sogou.com/web?query=site%3A" &wd& "' target= ' _ Blank ' title= ' "&SoGouWebSite&" & #10; " &wd& "' Rel=nofollow class=ln>" &SoGouWebSite& "</a>"); "
End If
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
%>