Skip to content

Instantly share code, notes, and snippets.

@raulsouzalima
Created January 25, 2010 08:47
Show Gist options
  • Save raulsouzalima/285734 to your computer and use it in GitHub Desktop.
Save raulsouzalima/285734 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'hpricot'
require 'open-uri'
html = Hpricot(open('http://ip.appspot.com/'))
ip = html.inner_html.gsub("\n",'')
puts ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment