Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Get external IP address (See related posts)

Another snippet code goes here:http://snippets.dzone.com/posts/show/3947 by ttmrichter

enjoy:)
require 'open-uri'
require 'rubygems'
require 'hpricot'

puts (Hpricot(open('http://myip.dk'))/"//td/font/b")[0].inner_html

Comments on this post

martinx posts on May 02, 2007 at 23:54
how can i use link,can it support

[text|url] or others?

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts