About this program...
Name    : LinkSure
Purpose :Check links in HTML documents
Author  :Richard Goodwin
Version :0.90 (November 2001)
Features: Check local links, and sites on the Internet.
          Now with added non-http checks
          (e.g. newsgroups, telnet, email).
Web     :http://www.goodwin.uk.com/richard/programs/
Status  :Freeware

This program is  Rich Goodwin 1999-2001; it may be freely distributed if:

      * All files remain intact and unaltered
      * No unreasonable charge is made

This program uses the EasySockets module by Justin Fletcher.

----------------------------------------------------------------------
Disclaimer

      * If it doesn't work, tough.
      * If it trashes anything, well, that's a good lesson in taking backups.

----------------------------------------------------------------------

Use

Drag a HTML, WML, PHP and SHTML documents on to the LinkSure icon or
main  window and sit back!

The Status area shows you what the program is currently trying to do;
the Previous area shows the result of this for the previously checked
link. Under this is a counter showing elapsed time (although this only
goes up after a link is checked, not during the actual checking).

There are also two buttons, Again and Cancel; Again will redo the check,
which is useful if you've checked a page and made corrections (you don't
have to drag the same file back in), and Cancel will either cancel the
currently active page check (after it finishes with whatever link it's
checking) or it will close the main window if there is no checking going
on.

The main bulk of the results page shows the URL being checked (with a
little icon to show what type of URL it is), the HTTP result code and an
English translation. At the top is a summary of this - 404 (not found)
and 500 (server error) problems are counted as major problems, and
redirections (the fact that you could probably use a more direct URL)
are counted as minor problems which you could probably ignore. The
meaning text is usually coloured so you can pick out errors quickly -
ranging from green (OK) to red (not found or server error).

New link types

Previously the program ignored anything that wasn't in the form 
href="http://<some_stuff>/file.ext", href="../file.ext" or 
href="file.ext". However, I've tried to add to the functionality so that
a wider range of link types are covered.

Three new link types that are supported are anchors (href="#topofpage"),
newsgroups and telnet. Anchors work by pre-processing your web page and
doing a simple check for any name="..." or id="..." anchors being set up
(up to 200); then when the program encounters a link to one of these
anchors it checks its internal database to see if it is valid. If the
anchor is present all's well and good; if there's an anchor of the same
name but with a different case, that'll be flagged as a minor problem;
and if the anchor isn't found it'll come up as an error.

Newsgroups

Newsgroup links are tested by connecting to a CGI script on my web
server and checking a news server to see if the group is valid; as such
you need to be online to do this test. This was done in this particular
way because an offline version would require a huge database of
newsgroups (at least two megabytes), and an online check is much easier
to achieve via a CGI than a desktop BASIC program. It does mean that,
for instance, if you're connected via a service other than the one I'm
using you might not get a true result.

Format: I used to use news:group, but apparently the format is
news://group.

Telnet

Telnet URLs are checked purely by trying to connect to the given server
on the given port, or port 23 (telnet) by default.

Format: telnet://server:port (any filenames afterwards are ignored). I
thought telnet:server was fine, but it confuses some browsers,
especially if you want to specify a port.

Ports: Here's a few useful ports; if you're really weird you can use
LinkSure to try  connecting to servers on certain ports to see if the
mail, ftp etc. daemons are running

      21 ftp
      22 ssh (secure telnet)
      23 regular telnet
      25 smtp (mail sending)
      79 finger
      80 web server
      110 pop3 (mail fetching)
      119 nntp (newsgroups)

Mail

Mail is checked for @ characters (too few or too many), and domains with
no full stops in are flagged; bad links with @ in which could be email
links without the mailto: on the front are also mentioned.

If you're online, and the address didn't fail the above checks, then
another CGI on my server will attempt to telnet into the mail server for
that domain and figure out if the address is valid (for the techie I'm
using RCPT TO rather than VRFY or EXPN, as the latter are usually
disabled for security reasons).  A positive or negative response is easy
enough to figure out, but some servers don't give any usable response so
I've made these return 302 ("ambiguous response" in this case, rather
than a proper HTTP "redirected" message).  In these cases you're going
to have to find another way to check I'm afraid.  I also don't check
fallback servers etc., but I do look up the correct MX record for the
mail domain.

Other link types

FTP links are not currently checked, but the format is looked at - for
example only  ftp:// is valid - ftp:/ and ftp:/// are flagged as errors.

I've also  added support for root directories, so links in the form
href="/index.html" can now be checked. See the sections below for more
information.

----------------------------------------------------------------------

Options

New in version 0.80 are some simple options, which can be accessed from
the menu or  by clicking with the right-hand mouse button (Adjust) on
the LinkSure iconbar icon.

* Check offline links only will switch off any remote checks, handy if you're
  not connected to the Internet and just want to check links on your hard drive.
* Skip news check. Newgroup checks require LinkSure to connect to some CGI 
  scripts on my website; you can skip this individually, or obviously if you're
  only checking offline links any checks that require an online checker will
  also be skipped.
* Skip mail server check. LinkSure can try to connect to the SMTP port on the
  mail server at the domain specified in the email address; if this fails
  it'll try adding "smtp." to the front. Obviously this requires Internet
  access, one or more attempts at a telnet connection and even then you
  can't be sure that the email address is valid, only that the domain exists
  and probably accepts mail.
* Root directory sets where the program starts looking for files reference
  in the following way: href="/index.html" (i.e. starting with a slash).
  The program can automatically detect some directory names as being probable
  roots, but it's safer and more accurate to set it yourself.

Clicking OK will set the options, and Cancel exits the window without
changing what the options were before you opened the window. You've got
to click OK for the options to be activated.

The options are automatically saved when you quit the program, and
loaded when you  start the program, so LinkSure should always start up
with the same options as when you last used it.

----------------------------------------------------------------------

Getting the best out of it

Absolute links

One of the things I've added is checking for links in the form of
href="/index.html". I  didn't use a lot of these types of links when I
first wrote the program because you can't follow them locally - if you
load the file off your hard drive and have a link or image referenced in
this form, the web browser won't know where to find it (which is exactly
the same problem LinkSure had). However, for big websites with a
standard navigation layout this type of link is a must, unless you want
to change every page by hand (or use server-side includes for
navigation, in which case LinkSure won't see any of those links!).

To get around the problem of not knowing where "/" refers to, LinkSure
needs to know the directory on your hard drive that "/" equates to. This
can be achieved in two ways - either set the root in the options window,
or let the program check the path of the file you drag in for you.

If you're using the automatic version, LinkSure will look through
filename of your  webpage for instances of "site." and "pages." -
directories ending in pages or site. The check is case insensitive, and
you can have other characters on the start of the directory name, such
as WebPages. The program then works out how to get from your file to
this directory, and once it's got there it checks the link as normal. If
you want to use this method however, you might need to move your website
to a new directory, which might mess up programs that check to see if
any files have been updated.

This does mean that if your site legitimately has a pages directory in
it (e.g.  http://www.domain.com/book/pages/example.html) LinkSure will
incorrectly  assume example.html is in the root of the domain if it's
checking these types of links.  To get around this you'll have to set
the root directory manually in the options window.

Verifying links "by hand"

As with any machine checks, to be absolutely sure of a problem you
should really try to  verify things by hand, especially the major
errors. The program is getting better and  better at giving good
results, but it's best to be safe than sorry. This is why some things
that might not be considered errors but can't be properly verified - for
instance email addresses - still get flagged as potential problems.

----------------------------------------------------------------------

Problems

      * It just sits there.
        Some sites just  don't respond to requests for information, but newer
        versions  should time out after about 30 seconds to a minute.

----------------------------------------------------------------------

Signing off

Rich Goodwin
richard@goodwin.uk.com
First published Thursday 4th November 1999
