Re: Get IP Address
Re: Get IP Address
- Subject: Re: Get IP Address
- From: Paul Skinner <email@hidden>
- Date: Wed, 22 Oct 2003 14:43:23 -0400
This should work for everyone and shouldn't fail due to a single down,
moved or 404 server.
WanIP()
-->"66.255.29.146"
on WanIP()
set WIP to missing value
set siteList to {"
http://checkip.dyndns.org/",
"
http://whatismyip.com", "
http://www.whatismyipaddress.com",
"
http://ipid.shat.net/", "
http://www.edpsciences.com/htbin/ipaddress",
"
http://www.showmyip.com/"}
repeat with thissite in siteList
try
set WIP to item 1 of paragraphs of (do shell script "curl " &
thissite & " | tr -cs '[0-9\\.]' '\\012' | awk -F'.' 'NF==4 && $1>0 &&
$1<256 && $2<256 && $3<256 && $4<256 && !/\\.\\./'")
if WIP is not missing value then exit repeat
end try
end repeat
return WIP
end WanIP
PS
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.