<%
Response.Expires =-1
Response.AddHeader "Cache-control", "No-cache"
Response.AddHeader "Pragma", "No-cache"
Wd=request ("D")
If Request ("s") = "Sosos" Then
Sosourl= "Http://www.soso.com/q?w=link%3A" &wd& "&sc=web&ch=w.ptl&lr=chs"
Else
Sosourl= "Http://www.soso.com/q?w=site%3A" &wd& "&sc=web&ch=w.ptl&lr=chs"
End If
Tempstr= Gethttppage (Sosourl)
Dim sosowebsite
Set Reg=new Regexp
Reg. Multiline=true
Reg. Global=flase
ASP Soso Collection Query grab code
Reg. Ignorecase=true
Reg. pattern= "Search to approx (. | N) *?) Item Results "
Set matches = Reg.execute (TEMPSTR)
For each match1 in matches
Sosowebsite=match1. Value
Next
Set matches = Nothing
Set reg = Nothing
Sosowebsite=replace (Sosowebsite, "Search to about", "")
Sosowebsite=replace (Sosowebsite, "item result", "")
Sosowebsite=replace (Sosowebsite, "", "")
Sosowebsite=replace (Sosowebsite, ",", "")
Sosowebsite=replace (Sosowebsite, "", "")
If sosowebsite= "" Then
If Request ("s") = "Sosos" Then
Response.Write ("Document.Write" ("<a href= ' Http://www.soso.com/q?w=link%3A" &wd& "&sc=web&ch=") W.ptl&lr=chs ' 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.soso.com/q?w=site%3A" &wd& "&sc=web&ch=") W.ptl&lr=chs ' 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") = "Sosos" Then
Response.Write ("Document.Write" ("<a href= ' Http://www.soso.com/q?w=link%3A" &wd& "&sc=web&ch=") W.ptl&lr=chs ' target= ' _blank ' title= ' "&SosoWebSite&" & #10; " &wd& "' Rel=nofollow class=ln>" &SosoWebSite& "</a>"); "
Else
Response.Write ("Document.Write" ("<a href= ' Http://www.soso.com/q?w=site%3A" &wd& "&sc=web&ch=") W.ptl&lr=chs ' target= ' _blank ' title= ' "&SosoWebSite&" & #10; " &wd& "' Rel=nofollow class=ln>" &SosoWebSite& "</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
%>