rss
twitter
  •  

Endereço IP com ruby – IP Address with ruby

| Na(s) categoria(s) ruby |

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

Compartilhe:

  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • TwitThis
  • email
  • Rec6

Comente