URL comparisons
[1/6] from: hallvard::ystad::helpinhand::com at: 7-Apr-2003 19:34
Hi
Does anyone know how to get _both_ these comparisons to yield true?
>> http://www.uio.no/ = http://www.uio.no/
== true
>> http://www.uio.no/ = http://www.uio.no
== false
So far, I've had to do like this:
>> difference parse http://www.uio.no/ ":/" [""]
== ["http" "www.uio.no"]
>> difference parse http://www.uio.no ":/" [""]
== ["http" "www.uio.no"]
which yields the same block. But I'd really like a shorter way to do it. All tips are
welcome.
~H
[2/6] from: ingo:h-o-h at: 7-Apr-2003 21:32
Hi Hallvard,
maybe 'dirize could be of help to you ...
>> http://www.uio.no/ = dirize http://www.uio.no
== true
>> http://www.uio.no/ = dirize http://www.uio.no/
== true
Kind regards,
Ingo
Hallvard Ystad wrote:
[3/6] from: tomc:darkwing:uoregon at: 7-Apr-2003 16:48
I do not have a shorter way but I do have a way that addresses
a few more problems than a trailing slash...
canotical-url: func[ url /local t p q][
replace/all url "\" "/"
t: parse url "/"
while [p: find t ".."][remove remove back p]
while [p: find t "."][remove p]
p: find t ""
while [p <> q: find/last t ""][remove q]
for i 1 (length? t) - 1 1[append t/:i "/"]
to-url url-encode/re rejoin t
]
sorry in advance for the warts..
it was written at least a year ago when
I needed to solve the problem quickly
(ran in to relative paths causing infinate loops)
there are very likely better ways to do some parts
and I look forward to any improvements
On Mon, 7 Apr 2003, Hallvard Ystad
wrote:
[4/6] from: rebolek::seznam::cz at: 8-Apr-2003 8:36
=?iso-8859-2?Q?Re=3A=20=5BREBOL=5D=20URL=20comparisons?=
Hi,
is this enough?
>> equal? to string! http://www.uio.no/ to string! http://www.uio.no/
== true
>> equal? to string! http://www.uio.no/ to string! http://www.uio.no
== false
bye, bolek
Hallvard Ystad wrote:
>Hi
>Does anyone know how to get _both_ these comparisons to yield true?
<<quoted lines omitted: 8>>
>== ["http" "www.uio.no"]
>which yields the same block. But I'd really like a shorter way to do
it. All tips are welcome.
>
>~H
>
>Prætera censeo Carthaginem esse delendam
>
______________________________________________________________________
Reklama:
Pouze p=ECniv=E1 Plze=F2 p=F8in=E1=B9=ED prav=E9 pot=EC=B9en=ED Kam na Plze=F2?
http://www.pilsner-urquell.cz?poteseni
[5/6] from: hallvard:ystad:helpinhand at: 8-Apr-2003 16:19
Re: URL comparisons
Yup, that solves the problem in some cases. But I don't alway know when I can use 'dirize
and not. Sometimes I'll have, say http://www.uio.no/index.html (and I don't expect it
to be equal to http://www.uio.no/, although in some respects, it is). So I guess for
the moment that I'll stick to my own solution. Thanks anyway.
~H
Dixit Ingo Hohmann (21.32 07.04.2003):
[6/6] from: hallvard:ystad:helpinhand at: 8-Apr-2003 16:21
Dixit Tom Conlin (01.48 08.04.2003):
>I do not have a shorter way but I do have a way that addresses
>a few more problems than a trailing slash...
<<quoted lines omitted: 8>>
> to-url url-encode/re rejoin t
>]
Well, it doesn't really address my needs, but thanks anyway.
~H
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted