• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get IP Address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Get IP Address (From: John Baltutis <email@hidden>)

  • Prev by Date: RE: Applescript bugs in Panther
  • Next by Date: Re: Finder: using "on adding folder items to..."
  • Previous by thread: Re: Get IP Address
  • Next by thread: Re: Get IP Address
  • Index(es):
    • Date
    • Thread