Endereço IP com ruby – IP Address with ruby
| Posted in ruby | Posted on 25-01-2010
0
Dica rápida de como obter o endereço IP via ruby.
Quick tip on how to get the ip address via ruby.
require 'rubygems'
require 'hpricot'
require 'open-uri'
html = Hpricot(open('http://ip.appspot.com/'))
ip = html.inner_html.gsub("\n",'')
puts ip



