Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: URL handling

From: hallvard:ystad:helpinhand at: 17-Aug-2003 20:49

Dixit A J Martin (02.29 17.08.2003):
>Hallvard wrote: >> I was looking for a URL handler script. Didn't find any. (Didn't someone >write a rebol web browser??) So I had to make one of my own: > > >Uhm, what does a URL handler do?
Oh, well, maybe that wasn't all that obvious. You give a URL as input to the script, and initialize the object. The handler then knows the different parts of the object: protocol (http), host (, path (/docs), query-part (what=something), section (#sect1). By using 'move-to, you tell the script something has changed, and the object remembers the new settings. I needed such an object because I was irritated by this (cut from console session):
>> =
== false So, in my script, the above two URLs are parsed into being alike:
>> site1: make url-handler [url:] >> site1/init
>> site2: make url-handler [url:] >> site2/init
== I still don't know how to tell if "last" is a file or a folder in the following URL: so I don't know whether or not to put a slash at the end (can anyone help me?), but for many other cases, the script works perfectly well. Thanks for your attention Hallvard