[REBOL] Re: url domain
From: hallvard:ystad:helpinhand at: 8-Oct-2003 8:55
Dixit "patrick" <[patrick--philipot--laposte--net]> (Tue, 7 Oct
2003 10:07:02 +0200):
>Thanks Anton
>
>finally I will use 'parse to get the domain URL.
Parse is excellent for the job.
Now, if I may, I'd like to brag about my script again
(http://folk.uio.no/hallvary/rebol/url-handler.r): it
handles both relative and absolute URLs, and serves you
the portion you need. You just 'do the script, and it then
works like this:
site: url-handler http://www.rebol.com
print site/url ; == http://www.rebol.com/
site/move-to "docs.html"
site/move-to
http://www.rebol.com/docs/core23/rebolcore-1.html
site/move-to "#sect1"
print site/protocol ; == "http://"
print site/host ; == "www.rebol.com"
print site/path ; == "/docs/core23/rebolcore-1.html"
print site/query-part ; == ""
print site/section ; == "#sect1"
I think I have a newer version than the one on my site
right now, but I won't be able to update it before this
evening.
Thanks for reading,
HY