If WScript. Arguments. Count <> 1 Then
WScript. Echo "Example: CScript" & WScript. ScriptName & "www.sohu.com"
WScript. Quit
End If
Url = "http://www.seologs.com/ip-domains.html? Domainname = "& WScript. Arguments (0)
Set oXMLHttpRequest = CreateObject ("Msxml2.XMLHTTP ")
OXMLHttpRequest. Open "GET", url, False, False
OXMLHttpRequest. Send
Str = oXMLHttpRequest. ResponseText
Ipos = instr (str, "<font face =" & Chr (34) & "arial" & Chr (34) & "> ")
Ipend = instr (str, "<! --- End loop ---> ")
Str = mid (str, ipos + 19, ipend-ipos-139)
Str = Replace (str, "<B> ","")
Str = Replace (str, "</B> ","")
Str = Replace (str, "<small> ","")
Str = Replace (str, "</small> ","")
Str = Replace (str, "</font> <font face =" & chr (34) & "arial" & chr (34) & "size =" & chr (34) & "-1" & chr (34) & "> ","")
Str = Replace (str, "Found", "Found ")
Iposa = instr (str, "")
Iposb = InStr (str, "1 )")
Stra = mid (str, iposa, iposb-iposa)
Str = replace (str, stra, "lcx ")
Str = replace (str, "lcx1)", "<br> 1 )")
'Wscript. echo str
Set oXMLHttpRequest = Nothing
Set objExplorer = WScript. CreateObject ("InternetExplorer. Application ")
ObjExplorer. Navigate "about: blank"
ObjExplorer. ToolBar = 0
ObjExplorer. StatusBar = 0
ObjExplorer. Visible = 1
Object explorer. height = 600
Object explorer. width = 500
ObjExplorer. left = 400
ObjExplorer. resizable = 0
ObjExplorer. Document. Body. InnerHTML = str
Objjavaser.doc ument. parentwindow. clipboardData. SetData "text", str
Set objExplorer = nothing
====================================== Regular:
Msg = "Enter the IP address or domain name you want to query :"
IP = Inputbox (msg, "domain name query", "www.haiyangtop.net ")
If IP = "" Then IP = "www.haiyangtop.net"
Url = "http://www.seologs.com/ip-domains.html? Domainname = "& IP &""
Body = getHTTPPage (url)
Set Re = New RegExp
Re. pattern = "(<font face =" "arial" "> [\ s \ S] + </font> </td> </tr> </table> )"
Set Matches = Re. Execute (Body)
If Matches. Count> 0 Then Body = Matches (0). value
Set oXMLHttpRequest = Nothing
Set objExplorer = WScript. CreateObject ("InternetExplorer. Application ")
ObjExplorer. Navigate "about: blank"
ObjExplorer. ToolBar = 0
ObjExplorer. StatusBar = 0
ObjExplorer. Visible = 1
Object explorer. height = 300
Object explorer. width = 400
ObjExplorer. left = 400
ObjExplorer. resizable = 0
ObjExplorer. Document. Body. InnerHTML = IP & Body
'Objjavaser.doc ument. parentwindow. clipboardData. SetData "text", IP & Body
Set objExplorer = nothing
'Function Area
Function getHTTPPage (Path)
T = GetBody (Path)
GetHTTPPage = BytesToBstr (t, "GB2312 ")
End Function
Function GetBody (url)
On Error Resume Next
Set Retrieval = CreateObject ("Microsoft. XMLHTTP ")
With Retrieval
. Open "Get", url, False ,"",""
. Send
GetBody =. ResponseBody
End
Set Retrieval = Nothing
End Function
Function BytesToBstr (Body, Cset)
Dim objstream
Set objstream = CreateObject ("adodb. stream ")
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 = Nothing
End Function