Identifying subdomains and top-level domains in a URI

This is a discussion on Identifying subdomains and top-level domains in a URI within the Bind Users forums, part of the DNS and Related Forums category; Hi all, I've got a firefox extension in development that needs to react to site the person is viewing. ...


Go Back   Usenet Forums > DNS and Related Forums > Bind Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-31-2005
stan
 
Posts: n/a
Default Identifying subdomains and top-level domains in a URI

Hi all,

I've got a firefox extension in development that needs to react to site
the person is viewing. My challenge is to determine the base portion
of the URI--stripped of subdomains but including top-level domains.
E.g., for "http://www.google.com" I need to get "google.com", and for
"subdomain.domain.com.au", I need to get "domain.com.au". My current
naive system just takes the last two chunks, which means it thinks all
web pages from austrailia are the same site. (They'll all from
"com.au"!)

What's the intelligent way to do this? My only thought is work from
the right side of the URI, and keep grabbing chunks until I find one
that is NOT a top-level domain. But this seems like a cludge.
Any ideas? Thanks for any insight!

-stan


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:18 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0