From: James Edward Gray II Date: 2007-04-19T22:29:06+09:00 Subject: Re: [src/oneliner] Getting the IP from an external rescource in ruby On Apr 19, 2007, at 8:10 AM, mrpink wrote: > just for fun I wanna share this oneliner which prints you the > external IP on the screen :) > > require 'net/http' > > Net::HTTP.get_response(URI.parse('http:// > www.wieistmeineip.de')).body.scan(/^Ihre IP-Adresse ist.+/) { | > ipadresse| puts ipadresse.sub(/^.+">/,'').sub(/<.+$/,'') } Interesting. I expected my code to be equivalent, but it gives a different answer: $ ruby -r resolv -e 'p Resolv.getaddress("http://www.wieistmeineip.de")' "212.19.62.76" James Edward Gray II