If I may translate: the German parts into English:
Net::HTTP.get_response(URI.parse('http://www.whatismyip.com')).body.scan(/^Your WAN IP is.+/) { |ipadresse| puts ipadresse.sub(/^.+">/,'').sub(/<.+$/,'') }
The one liner resolves your external IP with the help of an external service.
A hint for mrpink: German is not widely spoken beyond Germany, Austria and Swiss, so it's a good idea to translate your output.
lol my output prints a plain IP-adress on the screen and nothing else and you're code is of course not working because you conducted my regular expression with an output string muahhh
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
If I may translate: the German parts into English:
Net::HTTP.get_response(URI.parse('http://www.whatismyip.com')).body.scan(/^Your WAN IP is.+/) { |ipadresse| puts ipadresse.sub(/^.+">/,'').sub(/<.+$/,'') }
The one liner resolves your external IP with the help of an external service.
A hint for mrpink: German is not widely spoken beyond Germany, Austria and Swiss, so it's a good idea to translate your output.