• 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: Deivy Petrescu <email@hidden>
  • Date: Wed, 22 Oct 2003 20:30:01 -0400

On Wednesday, Oct 22, 2003, at 17:37 US/Eastern, Michelle Steiner wrote:

On Wednesday, October 22, 2003, at 12:28 PM, Arthur Knapp wrote:

Sorry, I just noticed this thread. Did anyone suggest this? :

How can you use it to get the WAN IP address of your own router?


After Conaire's message, I looked for just that; getting my IP via my router.
First, mind you that this is not an option in an environment where we are not the administrator and might not have "password" to access the router.
I have a linksys at home. The code I use is below. Mind you that there is a lot of html tags, so I used a html parser

_______

set AppleScript's text item delimiters to {""}
set ip_external to "" & (do shell script "curl http://:email@hidden/Status.htm";)

--router.ip.address.here this should be something like 192.168.1.1 for the same router, but mileage might vary.

display dialog parse(ip_external)


to parse(ztext)
set {ASTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "<"}
set mytext to ""
set zlist to text items of ztext
repeat with l from 1 to count of text items of zlist
set AppleScript's text item delimiters to ">"
if l = 1 then
set mytext to mytext & text item 1 of (text item l of zlist)
else
try
set mytext to mytext & " " & text item 2 of (text item l of zlist)
end try
end if
end repeat
set AppleScript's text item delimiters to ASTID
set mytext to mytext as string
set AppleScript's text item delimiters to "}"
set mytext to text item -1 of mytext
set AppleScript's text item delimiters to "&nbsp;"
set mytext to text items of mytext
set AppleScript's text item delimiters to return
set mytext to mytext as string
set AppleScript's text item delimiters to IP
set mytext to text item 3 of mytext
set AppleScript's text item delimiters to return
set mytext to "IP " & text item 1 of mytext as string
set AppleScript's text item delimiters to ASTID
return mytext
end parse

____

I'd like to know how this can be done for Airport.
If anybody knows, please...




Regards

Deivy Petrescu
http://www.dicas.com/
_______________________________________________
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.

  • Follow-Ups:
    • Re: Get IP Address
      • From: Michelle Steiner <email@hidden>
    • Re: Get IP Address
      • From: Michelle Steiner <email@hidden>
    • Re: Get IP Address
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: Get IP Address (From: Michelle Steiner <email@hidden>)

  • Prev by Date: RE: applescript-users digest, Vol 3 #2094 - 14 msgs
  • Next by Date: Re: AS 2.0 Beta
  • Previous by thread: Re: Get IP Address
  • Next by thread: Re: Get IP Address
  • Index(es):
    • Date
    • Thread