This is a new version that uses the XML
service of showmyip.com
Since the source is an XML feed the parsing of the data is
much simpler and more accurate.
You can find the old script here if you want to see it.
Sample output:
129.44.139.251
pool-129-44-139-251.buff.east.verizon.net
20030410 050606 EDT Thursday, April 10th, 2003 05:06 am
Please note, if you plan to run this script unattended
from the task manager,
ShowMyIP.com requests that you limit your connections to
once every thirty
minutes.
'Code begins here
' XMLMyWANYIP.vbs
' 4-10-2003, Sadowski
' Copyright Paul R. Sadowski <aa089(at)bfn.org>
const URL = "http://xml.showmyip.com/"
set xmldoc = CreateObject("Microsoft.XMLDOM")
xmldoc.async=false
xmldoc.load(URL)
for each x in xmldoc.documentElement.childNodes
if x.NodeName = "ip" then
myip = x.text
end if
if x.NodeName = "host" then
myhost = x.text
end if
if x.NodeName = "timestamp" then
mytime = x.text
end if
next
myinfo = myip & vbCRLF & myhost & vbCRLF & mytime
wscript.echo myinfo
|
|
© 2003 by Paul R. Sadowski
All Rights Reserved. Used By Permission.
Comments to: Scripting
|