@DataBase GrabHTTP.guide
@$VER: GrabHTTP.guide 1.03 (28.1.97) Documentation for GrabHTTP 1.03
@(C) Copyright 1996-97 by Serge Emond
@Author Serge Emond

@WordWrap

@Node MAIN "GrabHTTP.guide/Contents"
@{jcenter}
________________________________________________________________________
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

@{fg highlight}@{u}GrabHTTP@{uu}@{fg text}

Version 1.03

Copyright (c) 1996-97 Serge Emond

________________________________________________________________________
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ

@{" Important note about this English documentation " Link ENGLISH}
@{" Introduction                                    " Link INTRODUCTION}
@{" Features                                        " Link FEATURES}
@{" Legal information                               " Link LEGAL}
@{" Requirements                                    " Link REQUIREMENTS}

@{b}@{" This is a beta release                          " Link BETA}@{ub}

@{" Usage                                           " Link ARGUMENTS}
@{" ARexx                                           " Link AREXX}

@{" Browsing Anonymously                            " Link ANONYMOUS}
@{" Robot Guidelines                                " Link GUIDELINES}

@{" Known bugs                                      " Link BUGS}
@{" The future                                      " Link TODO}
@{" Credits                                         " Link CREDITS}
@{" Author                                          " Link AUTHOR}
@{" Program history                                 " Link HISTORY}

@EndNode

@Node ENGLISH "GrabHTTP.guide/About English"

@{jcenter}@{u}@{b}A word or two about English@{ub}@{uu}

@{jleft}My primary language is French.  I read English very well but I'm sure what I write is awful.  Sorry about that.

I could write this in French but maybe @{b}you@{ub} could not read it!

When I will have some free time I will write the docs in French too but that's not now!

@EndNode

@Node INTRODUCTION "GrabHTTP.guide/Introduction"

@{jcenter}@{u}@{b}Introduction@{ub}@{uu}

@{jleft}I'm writing GrabHTTP because I want to build an HTTP robot.

An HTTP robot is a program that can automatically download one or more files using HTTP.  Then it can scan those files to search for references to other files that it download upon some conditions and so on...

GrabHTTP simply sits there and wait for ARexx commands when executed.  Its main purpose is to download files using HTTP.

@EndNode

@Node FEATURES "GrabHTTP.guide/Features"

@{jcenter}@{u}@{b}Features@{ub}@{uu}
@{jleft}@{lindent 4}@{pari -2}
@{par}- Not available yet - read the docs!
@EndNode

@Node LEGAL "GrabHTTP.guide/Legal information"

@{jcenter}@{u}@{b}Legal information@{ub}@{uu}

@{" License " Link LICENSE}

@{" No warranty " Link WARRANTY}

@EndNode

@Node LICENSE "GrabHTTP.guide/License"

@{jcenter}@{u}@{b}License@{ub}@{uu}

@{jleft}GrabHTTP is released under the concept of freeware. This means you are allowed to use and copy this program freely, as long as the following requirements are fulfilled:

@{jcenter}
     All files are copied without any alterations or modifications. If  any
     extra  files  are added, it must be obvious that they do not belong to
     the original distribution, and that they do not need to be included in
     any redistribution. Exception: So called "BBS ads" may @{i}not @{ui}be added.  @{}

     The copying is done on a non-commercial basis. A small  fee  to  cover
     media costs etc. may be charged.                                      @{}

     The copier is not claiming the copyright of this program.             @{}

@{jleft}Any exceptions from the above require a written permission from the author.

If you want to publish this program on a cover disk or similar, contact me first for approval (to make sure you have the latest version etc). I then expect a copy of the issue in question in return (additional contributions are welcomed :).

@EndNode

@Node WARRANTY "GrabHTTP.guide/Legal issues/No warranty"

@{jcenter}@{b}No warranty@{ub}@{uu}

There is no warranty for the programs, to the extent permitted by  applicable
law.  Except  when  otherwise  stated  in writing the copyright holder and/or
other parties provide the programs "as is"  without  warranty  of  any  kind,
either  expressed  or  implied,  including,  but  not limited to, the implied
warranties of merchantability and  fitness  for  a  particular  purpose.  The
entire  risk  as  to the quality and performance of the programs is with you.
Should the programs prove defective, you assume the  cost  of  all  necessary
servicing, repair or correction.                                             @{}

In no event unless required by applicable law or agreed to  in  writing  will
any copyright holder, or any other party who may redistribute the programs as
permitted above, be  liable  to  you  for  damages,  including  any  general,
special,  incidental  or  consequential  damages  arising  out  of the use or
inability to use the programs (including but not limited to loss of  data  or
data being rendered inaccurate or losses sustained by you or third parties or
a failure of the programs to operate with any other programs), even  if  such
holder   or  other  party  has  been  advised  of  the  possibility  of  such
damages.                                                                     @{}

@{jleft}
@EndNode

@Node REQUIREMENTS "GrabHTTP.guide/Requirements"

@{jcenter}@{b}Requirements@{ub}@{uu}

@{jleft}GrabHTTP needs at least OS v39 (3.0).  It also requires AmiTCP 4.0+.

@EndNode

@Node HISTORY "GrabHTTP.guide/History"

@{jcenter}@{u}@{b}What has been done@{ub}@{uu}
@{jleft}@{pari -4}@{lindent 4}
@{par}Version 0 Revision 1 - 16.8.1996 and before
- Nothing recorded.
@{par}Version 0 Revision 2 - 16.8.1996
- Checks if port already exists
- ARexx Command VERSION
- Read/write to socket not buffered anymore
- A lot of other unlogged stuff
@{par}Version 0 Revision 3 - 19.8.1996
- Replaced console output with window
@{par}Version 0 Revision 4 - 9.9.1996
- Now fully RFC-1945 compliant
- Use HEAD instead of GET if HeaderOnly opt is used.  (Smarter)
- Does not enforce ifmodified anymore
- More information when an error occurs
- Strip CR/LF when using GetHeaderString()
- Bug fixed in SetTimeZone: hours were directly added to mins (and not × 60)
@{par}Version 0 Revision 5 - 10.9.1996
- Does not use TCP: anymore (yé!)
@{par}Version 0 Revision 6 - 7.12.1996
- New CLI option: write buffer size
@{par}Version 0 Revision 7 - 16.12.1996
- Should not add "index.html" randomly to the filename.
- New ARexx function: TRANSLATE
@{par}Version 0 Revision 8 - 6.1.1997
- Reports error 200 when a file is incomplete.
- Added option TouchDirs to the ARexx command @{"GetHTTPFile" Link GETHTTPFILE}.
@{par}Version 0 Revision 9 - 13.1.1997
- LF was removed when saving headers!
- Was writing NULLs in memory [not belonging to GrabHTTP] - Fixed
- At last!  Close gadget works even when not receiving anything! (ie while looking up or remote host frozen)  It really was a stupid error!
@{pard}@{lindent 0}

14.1.97 - I think it's time to use a real version number.  (0.9 + 0.1 = 0.10...)  There are bugs but it is more than stable on @{b}my@{ub} system. => 0.9 -> 1.0

@{jleft}@{pari -4}@{lindent 4}
@{par}1.01 - 17.1.1997
- Fixed FreeMem twice when setting & then clearing EMail address/username
- Now supports HTTP autorization (See @{"SetAuth" Link SetAuth}
@{par}1.02 - 20.1.1997
- Completely new window!!  Now uses gadtools.library, except for the progress-bar.
- Now includes a user-field that can be set via ARexx (See @{"SetProgressInfo" Link SETPROGRESSINFO}).
- Uses ScreenFont for window.  If the resulting window is too big, Topaz is used. (And if this fails too, no window!).
- Increased receive-buffer from 2k to 4k.  (Don't know if it can help to receive faster on faster lines, I using a 14.4k modem!)
@{par}1.02 - 28.1.1997
- Bug fixed with window: some text was misplaced by gadtools.lib V39
@{pard}@{lindent 0}

@EndNode

@Node TODO "GrabHTTP.guide/What's next"

@{jcenter}@{u}@{b}What's Next - The To Do List@{ub}@{uu}
@{jleft}@{lindent 4}
· Proxy support
· Use a separated process to grab a file
· Allow any number of grab with a single grabhttp started
· Allow different config structs for each process

@EndNode

@Node BUGS "GrabHTTP.guide/Bugs"

@{jcenter}@{u}@{b}Known Bugs@{ub}@{uu}

@{jleft}- None known (for now!)

@EndNode

@Node CREDITS "GrabHTTP.guide/Credits"

@{jcenter}@{u}@{b}Credits@{ub}@{uu} @{jleft}GrabHTTP is completely written by @{"Serge Emond" Link Author}. Since I could not access any RFC during this summer, I looked in GetURL.rexx to see how HTTP worked. Then I tried it with the only HTTP server I could use in my situation (no internet access :), aws 0.97. I now have RFC-1945 documentation and GrabHTTP has been completely revised to comply with it.

aws is a small but efficient HTTP server written by Mike Meyer.  Have a look in @{b}FTP://max.physics.sunysb.edu/pub/amiga/amosaic/aws/@{ub}.

GetURL.rexx is an ARexx script written by James Burton.  Have a look on AmiNet. (comm/www/GetURL-1.06.lha)

@EndNode

@Node AUTHOR "GrabHTTP.guide/Author"

@{jcenter}@{u}@{b}About the author@{ub}@{uu}

@{jleft}Name: Emond
First Name: Serge

Current email: emonds@jsp.umontreal.ca
Current web: http://www.jsp.umontreal.ca/~emonds/

@EndNode

@Node MIME "GrabHTTP.guide/MIME Types"

@{jcenter}@{u}@{b}MIME@{ub}@{uu}

@{jleft}@{i}What follows come directly from AWeb's HTML documentation: @{ui}

MIME (Multipurpose Internet Mail Extensions) is a mechanism for specifying and describing the format of Internet message bodies.  It was primarily designed for e-mail, but MIME types are used also to identify the type of data in the HTTP protocol, the most widely used protocol on the World Wide Web.

A MIME type consists of a @{i}type @{ui}and a @{i}subtype.@{ui}  The @{i}type @{ui}describes the major class of data, like text or image.  The @{i}subtype @{ui}is used for a subdivision of the major type into different formats, like GIF or JPEG images.

According to RFC 1521, the following official MIME types are defined:

@{b}TEXT/HTML@{ub}@{lindent 4}
This is a document in the HTML hypertext format.  Virtually all pages on the Web are in this format.@{lindent 0}

@{b}TEXT/PLAIN@{ub}@{lindent 4}
This type is used for plain text documents (normally in ASCII).@{lindent 0}

@{b}APPLICATION/OCTET-STREAM@{ub}@{lindent 4}
This describes a binary file.  The file could be processed by some application.  An example of this would be an LHA archive.@{lindent 0}

@{b}APPLICATION/POSTSCRIPT@{ub}@{lindent 4}
The document is in PostScript format.@{lindent 0}

@{b}IMAGE/GIF
IMAGE/JPEG@{ub}@{lindent 4}
These are images, in GIF and JPEG format.@{lindent 0}

@{b}AUDIO/BASIC@{ub}@{lindent 4}
This type is used for audio data encoded using 8-bit ISDN mu-law [PCM].@{lindent 0}

@{b}VIDEO/MPEG@{ub}@{lindent 4}
This is an animation in MPEG format.@{lindent 0}

In addition to these official types and subtypes, it is allowed to define extension MIME types and subtypes.  These should start with @{b}X-@{ub} to avoid collisions with future official MIME types.

@EndNode

@Node HTTP "GrabHTTP.guide/HTTP Protocol"

@EndNode

@Node PROGRESS "GrabHTTP.guide/Progress Indicator"

GrabHTTP's progress indicator looks like this:

@{jcenter}@{fg highlight} Url: <url>                                               @{}
File: <file>                                              @{}
                                                          @{}
 Received: <size>             Actual: <actual>            @{}
Chars/sec: <cps>           Remaining: <remaining>         @{}
                                                          @{}
@{bg text} Status                                                   @{bg back}
@{bg text} User Status                                              @{bg back}
                                                          @{}
@{bg text}                           100%                           @{bg back}
                                                          @{}
@{bg text} Skip this file @{bg back}                         @{bg text} Abort transfert @{fg text}@{bg back}

@{jleft}Here's the meaning of each field:

@{b}<url>@{ub}@{lindent 4}
This is the URL GrabHTTP is receiving.@{lindent 0}

@{b}<file>@{ub}@{lindent 4}
This the name of the file the datas are saved.@{lindent 0}

@{b}<size>@{ub}@{lindent 4}
This is the number of bytes received and the size of the file given this way:
    <received> / <size>
If the server does not give the size, only "<received>" is given.@{lindent 0}

@{b}<cps>@{ub}@{lindent 4}
This is the rate at which we are receiving the file - number of bytes/sec.@{lindent 0}

@{b}<actual>@{ub}@{lindent 4}
This is the time the transfer took up to now.@{lindent 0}

@{b}<remaining>@{ub}@{lindent 4}
This is the calculated remaining time.@{lindent 0}

@{b}<status>@{ub}@{lindent 4}
This is the status of the transfert.  Errors are reported here.@{lindent 0}

@{b}<User Status>@{ub}@{lindent 4}
This is information set with @{"SetProgressInfo" Link SETPROGRESSINFO}@{lindent 0}

@{b}<100%>@{ub}@{lindent 4}
This the progress bar:  it fills as we receive the file.  It remaing completely blank if the size information is unknown.@{lindent 0}

@{b}<Skip this file>@{ub}@{lindent 4}
Pressing this button aborts the current transfert.@{lindent 0}

@{b}<Abort transfert>@{ub}@{lindent 4}
Pressing this button aborts the complete transfert.  This is the same as pressing the CloseGadget.@{lindent 0}

@EndNode

@Node ANONYMOUS "GrabHTTP.guide/Browsing Anonymously"

@{jcenter}@{b}@{u}Browsing Anonymously@{uu}@{ub}
@{jleft}
An HTTP request can have a field containing email and name information about the user. This way, some people send their email address on every server they connect to. Most of the time it won't do anything but... there are twisted webmasters who use this information to send anoying emails ie to sell products.

It you want to see if your Web Browser sends such information without letting you knowing about it, have a look at this page: @{b}HTTP://www.uiuc.edu/~ejk/WWW-privacy.html@{ub}.

By default GrabHTTP won't send @{b}any@{ub} information about the user. In fact, there is absolutely no function allowing to grab any information from your system so you can be sure it won't send anything. :)

If you really want to send your email, there is an ARexx command allowing to do so. (@{"SetEMail" Link SETEMAIL})

You should have a look at the @{"Robot Guidelines" Link GUIDELINES}.

@EndNode

@Node GUIDELINES "GrabHTTP.guide/Robot Guidelines"

@{jcenter}@{b}@{u}Robot Guidelines@{uu}@{ub}
@{jleft}
If you did not read the @{"Browsing Anonymously" Link ANONYMOUS} section, you should do it now.

GrabHTTP is a robot.  This means it can download stuff and do things without any user around to check what it does.

If something goes wrong or if GrabHTTP annoys webmasters, they can complain to your internet provider (or the root of your network or anyone else) and you will be the one suffering from it.

Because of this, even if you like to be anonymous, it could be a very good idea to send your email at each request.

This way, server maintainers can contact you and start a dialogue on better terms than if you were hard to track down.

The choice is yours!

@EndNode

@Node BETA "GrabHTTP.guide/This is BETA"

@{jcenter}@{b}@{u}This is a BETA release@{uu}@{ub}

@{jleft}This release is BETA.  This means it has @{b}not@{ub} been fully tested.  I release it only because it seems stable and it works well on my computer.  As stated in @{"legal issues" Link WARRANTY} I may not be responsible for any dammage caused by the use of this program.

@EndNode

@Node ARGUMENTS "GrabHTTP.guide/Arguments"

@{jcenter}@{b}Arguments@{ub}@{uu}

@{jleft}GrabHTTP can only be started from a Shell.

You can break it at anytime by sending CTRL-C.

    @{b}Text arguments@{ub}
    @{" PORT     " Link PORT}    Name of the ARexx port.
    @{" ACCEPT   " Link ACCEPT}    What type of file to accept.
    @{" WBUF     " Link WBUF}    Size of write buffer.

@EndNode

@Node PORT "GrabHTTP.guide/Arguments/Port"

@{u}@{b}Port@{ub}@{uu} (PORT)

It represents the name of the ARexx port GrabHTTP will use.  The default port name is "GRABHTTP".

You should use an uppercase port so you won't have to enclose the port's name in quotes in your ARexx scripts.

See also:
    @{" ARexx " Link AREXX}

@EndNode

@Node ACCEPT "GrabHTTP.guide/Arguments/Accept"

@{u}@{b}Accept@{ub}@{uu} (ACCEPT/K)

When given, it overwrites the default setting of "*/*".  This represent the @{"MIME types" Link MIME} to accept.  "*" means "all".

For example, if you only want to receive images, you can specify "image/*".  If you only want to receive HTML files, specify "text/html".

The remote server may not know the type of a file and send it as text/plain (or something else).

@EndNode

@Node WBUF "GrabHTTP.guide/Arguments/WriteBufferSize"

@{u}@{b}WBuf@{ub}@{uu} (WBUF/N)

This is the size of write buffer to use in bytes.  GrabHTTP write to disk only when the buffer is full.  If the given value is smaller than 2048 then 2048 is used.  Default is 16k (16384 bytes).

@EndNode

@Node AREXX "GrabHTTP.guide/Using ARexx"

@{jcenter}@{u}@{b}Introduction@{ub}@{uu}

@{jleft}Each time a command is received, two things are set in the calling rexx script:  the RC variable and a special variable named "GHRES".  GHRES will be set to a NULL-string if nothing is to be returned so copy it if you want to use what's in it after calling another command.

At anytime you can receive one of these return-codes:

    10      Command unknown/mispelled
    15      Error setting secondary result variable (GHRES)

Here's a list of all ARexx commands supported:

    @{" GETBYTERECD       " Link GETBYTERECD}
    @{" GETCPS            " Link GETCPS}
    @{" GETHEADERSTRING   " Link GETHEADERSTRING}
    @{" GETHTTPFILE       " Link GETHTTPFILE}
    @{" GETSIZE           " Link GETSIZE}
    @{" GETTICKS          " Link GETTICKS}
    @{" QUIT              " Link QUIT}
    @{" SETAUTH           " Link SETAUTH}
    @{" SETDIR            " Link SETDIR}
    @{" SETEMAIL          " Link SETEMAIL}
    @{" SETMINSPACELEFT   " Link SETMINSPACELEFT}
    @{" SETPROGRESSINFO   " Link SETPROGRESSINFO}
    @{" SETTIMEZONE       " Link SETTIMEZONE}
    @{" TRANSLATE         " Link TRANSLATE}

@EndNode

@Node GETBYTERECD "GrabHTTP.guide/ARexx/GetByteRecd"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}
GetByteRecd -- Get the number of bytes received during last transfer.

@{par}@{b}SYNOPSIS@{ub}
GetByteRecd

@{par}@{b}FUNCTION@{ub}
It returns the number of bytes received (and wrote to disk) during the last transfert.

@{par}@{b}ARGUMENTS@{ub}
None.

@{par}@{b}RC@{ub}
0   No error.

@{par}@{b}GHRES@{ub}
Bytes received.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node GETCPS "GrabHTTP.guide/ARexx/GetCPS"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
GetCPS -- Get the CPS rating of the last transfer.

@{par}@{b}SYNOPSIS@{ub}
GetCPS

@{par}@{b}FUNCTION@{ub}
Returns the CPS rating (characters per second) the speed of the last transfer.  This is calculated by dividing the number of received bytes per the total time of transfert.

@{par}@{b}ARGUMENTS@{ub}
None.

@{par}@{b}RC@{ub}
0   No error.

@{par}@{b}GHRES@{ub}
Contains the last CPS rating or 0 if no transfer yet or if it failed before any CPS rating could be calculated.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node GETHEADERSTRING "GrabHTTP.guide/ARexx/GetHeaderString"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
GetHeaderString -- Get information contained in header.

@{par}@{b}SYNOPSIS@{ub}
GetHeaderString STRING

@{par}@{b}FUNCTION@{ub}
This returns information contained in the header the remote host sent.  An header is built this way:

    HTTP/1.0 200 OK
    Server: aws/0.97
    Date: Sat, 17 Aug 1996 21:20:50 GMT
    Content-Type: text/html
    Last-Modified: Thu, 05 Oct 1995 23:54:06 GMT
    Content-length: 456
    (etc....)

The arguments specifies the @{i}left @{ui}part of the string you want to know about.  This is case insensitive.  Example:

    address grabhttp 'GetHeaderString sErV'
    if rc ~= 0 then say ghres
    else say 'No server information'

The above example would print the line "Server: aws/0.97" if this information is available.

Notes:  · There is NO CR & LF.
        · You can obtain the size of the file with this command but @{"GetSize" Link GETSIZE} is more efficient.

@{par}@{b}ARGUMENTS@{ub}
@{b}STRING@{ub}@{lindent 12}
String to search.  Default string: "HTTP/1.0"

@{par}@{b}RC@{ub}
0   No error.
1   String not found.
5   Error parsing arguments.

@{par}@{b}GHRES@{ub}
Contains the string requested.

@{par}@{b}SEE ALSO@{ub}
@{" GetSize " Link GETSIZE}

@{pard}
@EndNode

@Node GETHTTPFILE "GrabHTTP.guide/ARexx/GetHTTPFile"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
GetHTTPFile -- Grab a file using HTTP transfer protocol.

@{par}@{b}SYNOPSIS@{ub}
GetHTTPFile URL/A FileName/K MaxSize/N HeaderOnly/S IfModified/S Progress/S SaveHeader/S TouchDirs/S

@{par}@{b}FUNCTION@{ub}
GetHTTPFile tells GrabHTTP to get a file and save it to disk.

@{par}@{b}ARGUMENTS@{ub}
@{b}URL@{ub}         (string)@{lindent 12}
Required.  Name of the URL to grab.  Must begins with "HTTP://".@{lindent 8}

@{b}FileName@{ub}    (string)@{lindent 12}
Name of the file to save.  If it ends with a slash ('/') then "index.html" will be added.  All inexistent directories will be created.  If not specified, a filename will be created from the URL given.  In that former case there won't be any path, the file will be saved in the @{"current directory" Link SETDIR}.  If the filename contains '#', it will be truncated.@{lindent 8}

@{b}MaxSize@{ub}     (int)@{lindent 12}
This sets the maximal number of bytes a file can have.  If the file to receive is bigger, the transfer will be aborted immediately after receiving the header.  In such a case, '106' will be returned in GHRES.  If this value is not specified, or if it is set to 0, then there won't be any size-checking.@{lindent 8}

@{b}HeaderOnly@{ub}  (switch)@{lindent 12}
Tells GrabHTTP to get the header and to abort the transfer at the start of the file.@{lindent 8}

@{b}IfModified@{ub}  (switch)@{lindent 12}
GrabHTTP will send a "If-Modified-Since: " flag when sending the request. If the remote server support this, it will only send the file if it is newer than the file on disk. This flag is useless if the file is not present on disk. You should set correctly the @{"timezone" Link SETTIMEZONE} prior to use this flag.@{lindent 8}

@{b}Progress@{ub}    (switch)@{lindent 12}
When present, this tells GrabHTTP to display @{"progress information" Link PROGRESS} about the actual file transfer.@{lindent 8}

@{b}SaveHeader@{ub}  (switch)@{lindent 12}
This tells GrabHTTP to save the header along with the file, or only the header if @{b}HeaderOnly@{ub} is set.  The filename for the header will be the same as for the file, with ".HDR" added.@{lindent 8}

@{b}TouchDirs@{ub}   (switch)@{lindent 12}
Tells GrabHTTP to "touch" the directories not created.  (Ie set the date of old directories to now) (See opt FileName above)

@{par}@{b}RC@{ub}
0   Result of the transfer in GHRES.
5   Failed to parse args.

@{par}@{b}GHRES@{ub}
  0     Everything went OK.
 97     Failed to create socket.
 98     Unable to alloc mem.
 99     Unable to alloc mem.
100     Remote did not reported "200 OK". (See @{"GetHeaderString" Link GETHEADERSTRING})
101     Bad/unsupported transfert method.  (Should begins with HTTP://)
102     Failed to open socket  (Ie host does not exists, no answer).
103     Failed to send HTTP request.
104     Host not found (Lookup error).
105     Failed to create required directories.
106     File is too big (See @{b}MSize@{ub} option).
107     Not enough space left on device (See @{"SetMinSpaceLeft" Link SETMINSPACELEFT}).
150     Error openning output file.
151     Written less bytes than received (error writing?).
161     Error reading header.
162     Error openning/writing header's file.
163     Header do not begin with "HTTP/1.".
164     Error allocating memory for header information (ie to use with @{"GetHeaderString" Link GETHEADERSTRING})
200     File is incomplete: Server closed the link before the end of file.
201     User pressed "Skip this file" gadget.
202     User pressed CloseWindow or "Abort transfert" gadget.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node GETSIZE "GrabHTTP.guide/ARexx/GetSize"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
GetLastModified -- Get the size of the file.

@{par}@{b}SYNOPSIS@{ub}
GetSize

@{par}@{b}FUNCTION@{ub}
Returns the "Size:" field of the transfer header received during last transfer.

@{par}@{b}RC@{ub}
0   No error.

@{par}@{b}GHRES@{ub}
Contains the size of the file received or an empty string if this information wasn't given.

@{par}@{b}SEE ALSO@{ub}
@{" GetHeaderString " Link GETHEADERSTRING}

@{pard}
@EndNode

@Node GETTICKS "GrabHTTP.guide/ARexx/GetTicks"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
GetTicks -- Get the total time the transfer took.

@{par}@{b}SYNOPSIS@{ub}
GetTicks

@{par}@{b}FUNCTION@{ub}
Returns the total time the transfer took in ticks.  One second contains 50 ticks.

@{par}@{b}ARGUMENTS@{ub}
None.

@{par}@{b}RC@{ub}
0   No error.

@{par}@{b}GHRES@{ub}
Contains the time the transfer took in ticks.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node QUIT "GrabHTTP.guide/ARexx/Quit"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
Quit -- Makes GrabHTTP exit.

@{par}@{b}SYNOPSIS@{ub}
Quit

@{par}@{b}FUNCTION@{ub}
Upon reception, GrabHTTP will free all its memory, close all what is openned, and... quit.

@{par}@{b}ARGUMENTS@{ub}
None.

@{par}@{b}RC@{ub}
0   No error.

@{par}@{b}GHRES@{ub}
Nothing.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node SetAuth "GrabHTTP.guide/ARexx/SetAuth"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
SetAuth -- Set username & password for HTTP authorization.

@{par}@{b}SYNOPSIS@{ub}
SetAuth USERKEY

@{par}@{b}FUNCTION@{ub}
Set the username and password to use HTTP authorization.  If not set, no auth information is sent.

You must supply the information this way:

    [username]:[password]

("[" and "]" must not be included).  The string then encoded using Base64 and is sent with @{b}every@{ub} request until this command is called again with no parameter.

Only "Basic" authorization is supported.  (Which is the only official authorization convention... see RFC-1945)

@{par}@{b}ARGUMENTS@{ub}
@{b}UserKey@{ub}        (string)@{lindent 12}
String containing the username and the password separated with a colon (:).

@{par}@{b}RC@{ub}
0   No error.
1   Failed to alloc memory to store authorization infos, no authorization used.
5   Failed to parse args.

@{par}@{b}GHRES@{ub}
Nothing.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node SETDIR "GrabHTTP.guide/ARexx/SetDir"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
SetDir -- Change GrabHTTP's current directory.

@{par}@{b}SYNOPSIS@{ub}
SetDir DIRECTORY

@{par}@{b}FUNCTION@{ub}
Makes GrabHTTP change its current directory.  Saved files without complete path will be saved relatively to this directory.  If no SetDir command is received, the current directory is the one where the program has been started.

@{par}@{b}ARGUMENTS@{ub}
@{b}Directory@{ub}       (string)@{lindent 12}
Name of the directory to go to.  It will not be created if it do not exists.  If no directory is specified, it will go to "PROGDIR:".@{lindent 8}

@{par}@{b}RC@{ub}
0   No error.
1   Failed to change directory.
5   Failed to parse args.

@{par}@{b}GHRES@{ub}
Nothing.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node SetEMail "GrabHTTP.guide/ARexx/SetEMail"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
SetEMail -- Set user information.

@{par}@{b}SYNOPSIS@{ub}
SetEMail EMAIL

@{par}@{b}FUNCTION@{ub}
Set user's email address.  If not set, @{b}no@{ub} user information will be sent and the user will be anonymous (see @{"Browsing anonymously" Link ANONYMOUS}).  The string should be something like:

    "UserName <email@address>"

@{par}@{b}ARGUMENTS@{ub}
@{b}EMail@{ub}           (string)@{lindent 12}
String containing name/email address of the user.  If absent, user will stay anonymous.@{lindent 8}

@{par}@{b}RC@{ub}
0   No error.
1   Failed to alloc memory to store email info, user is forced anonymous.
5   Failed to parse args.

@{par}@{b}GHRES@{ub}
Nothing.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node SETMINSPACELEFT "GrabHTTP.guide/ARexx/SetMinSpaceLeft"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
Set the minmla space to leave on device.

@{par}@{b}SYNOPSIS@{ub}
SetMinSpaceLeft BYTES/N

@{par}@{b}FUNCTION@{ub}
Set the minimal space that should be left on the device after reception of the file.  If there is not enough space on the disk for the file, @{"GetHTTPFile" Link GETHTTPFILE} will return 107 in GHRES.  This do not refers to @{"current directory" Link SETDIR}'s device but to the device that will contain the file.  No checking is done if this is set to 0, which is the default.

@{par}@{b}ARGUMENTS@{ub}
@{b}Bytes@{ub}           (int)@{lindent 12}
Number of bytes to keep free on the device receiving the file.  The default is 0 (feature disabled).@{lindent 8}

@{par}@{b}RC@{ub}
0   No error.
5   Failed to parse args.

@{par}@{b}GHRES@{ub}
Nothing.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node SETPROGRESSINFO "GrabHTTP.guide/ARexx/SetProgressInfo"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
SetProgressInfo -- Set GrabHTTP's information line on window

@{par}@{b}SYNOPSIS@{ub}
SetProgressInfo STRING

@{par}@{b}FUNCTION@{ub}
There's a line on GrabHTTP's window that can be set via the ARexx port.  It's the purpose of this function...

@{par}@{b}ARGUMENTS@{ub}
@{b}String@{ub}          (string)@{lindent 12}
String to use.  If no string is given, the information-line is cleared.@{lindent 8}

@{par}@{b}RC@{ub}
0   No error.
5   Failed to parse args.

@{par}@{b}GHRES@{ub}

@{par}@{b}SEE ALSO@{ub}
    @{" Progress Window " Link PROGRESS}
@{pard}
@EndNode

@Node SETTIMEZONE "GrabHTTP.guide/ARexx/SetTimeZone"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
SetTimeZone -- Set local timezone information.

@{par}@{b}SYNOPSIS@{ub}
SetTimeZone H=HOURS/N M=MINUTES/N

@{par}@{b}FUNCTION@{ub}
Set the time you must @{b}add@{ub} to the local time to obtain GMT time.  This is currently only used when using the IfModified switch of @{"GetHTTPFile" Link GETHTTPFILE}.  Minutes can range between -1440 and +1440 and hours between -24 and 24.  The total time must not exceed ħ24 hours (ħ1440 minutes).  The default is EST5.

@{par}@{b}ARGUMENTS@{ub}
@{b}Hours@{ub}           (int)@{lindent 12}
Number of hours to add to local time to obtain GMT.  If absent, 5 is used.@{lindent 8}

@{b}Minutes@{ub}         (int)@{lindent 12}
Number of minutes to add to local time to obtain GMT.  If absent, 0 is used.@{lindent 8}

@{par}@{b}RC@{ub}
0   No error.
1   GMT cannot be more than 1 day far.  Old value kept.
5   Failed to parse args.

@{par}@{b}GHRES@{ub}

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

@Node TRANSLATE "GrabHTTP.guide/ARexx/Translate"
@{lindent 8}@{pari -4}@{par}@{b}NAME@{ub}@{lindent 8}
Translate -- Change some characters in a string.

@{par}@{b}SYNOPSIS@{ub}
Translate STRING/A,TOKEN/A,TO/A

@{par}@{b}FUNCTION@{ub}
Changes all characters TOKEN into TO in the string STRING.  For example, if you give

    TRANSLATE "Hey didlo!" "!ed" "_**x"

You would obtain:

    H*y xixlo_

BE CAREFUL!!  dos.library's ReadArgs is used to parse args.  A single "*" is used as an escape character (I think!).  You should enter "**".  Since this also applies for the string to translate, the url name will probably be wrong if you don't transform "*" to "**.

Since "*" is used on most OS as a wildcard you should not encounter any url with "*" in it.

@{par}@{b}ARGUMENTS@{ub}
@{b}String@{ub}          (string)@{lindent 12}
String to translate.@{lindent 8}

@{b}Tok@{ub}             (string)@{lindent 12}
"From" characters.@{lindent 8}

@{b}To@{ub}              (string)@{lindent 12}
"To" characters.@{lindent 8}

@{par}@{b}RC@{ub}
0   No error. New string in GHRES.
1   "TOK" contains more characters than "TO".
5   Failed to parse args.

@{par}@{b}GHRES@{ub}
If RC=0, contains translated string.

@{par}@{b}SEE ALSO@{ub}

@{pard}
@EndNode

