parsing a URI's base authority

A

And80

Hi all,
I am looking for a ruby library to reliably determine the base
authority of a URI host.

example:

www.google.com => google.com
subdomain.domain.com.au => domain.com.au
www1.o2.co.uk => 02.co.uk
blah.jp => blah.jp


here is a javascript based solution to this problem.
http://getoutfoxed.com/node/41

Before trying to port this code in ruby, I was wandering if is there
any already existing ruby gem or
library designed to do this job...
so far I have not been to solve this problem by simply using the uri
parsing facilities included
in the ruby standard library.

thank you in advance,
Andrea
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top