to homepage
 Weekly emails: how to advanced search
 Glossary lookup:


> how to > AppSwitching diary

Tuesday, January 28, 2003

Liberal in what you accept

After a fair bit of weekend tinkering (and weekday catching up), the Loosely Coupled glossary now embodies my homage to the maxim attributed to Internet pioneer Jon Postel, "Be liberal in what you accept, and conservative in what you send."

The glossary will accept queries by any of three routes, but will always respond with a single answer conforming to a predictable format if it has a definition to offer. If it has no corresponding definition, it responds with a standardized page that allows further searching. Each of the three query alternatives conform to recognised standards, and all of it is designed to make it as easy and convenient as possible to use the glossary to find what you want to know.

All I need to do now, of course, having created the infrastructure, is populate the glossary with a few more definitions, at which point it will be promoted more aggressively via the main Loosely Coupled weblog and related content pages.

The three routes are:

  1. Via Javascript bookmarklet, as described currently on the glossary highlights page. The bookmarklet code is easily editable for those who want to vary it, or to adapt it for browser platforms other than Internet Explorer. The default setup has the extra term "&df=s" which selects a short format suitable for a popup window. Omitting this (by deleting the characters +'&df=s' from the code) will result in a full page format appearing instead.

  2. Via a simple HTTP-GET query, as for example in the following form:

    When creating the form, set the name of the input text as q, and the action as, like this:
    <form method="get"
    <input type="text" size="24" name="q" value="" />
    <input type="submit" value="lookup" /></form>
  3. By typing the term you want to search for straight into your browser's address bar, preceded by, for example: or coupling.

In all cases, the glossary is forgiving of excess trailing or leading spaces, and upper or lower case, making it easy to highlight or cut-and-paste words and phrases for looking up on the fly.

This has all been achieved thanks to the magic of PHP scripting, combined with nothing more complex than some XML files to store the definition data and Apache's Unix filesystem and 404 page-not-found error handling. The original inspiration for this approach came from Joe Gregorio's Well-Formed Web, although my actual implementation only gives the appearance of following his guidelines, as I've opted to hide the raw XML files so I can experiment with some proprietary elements away from public view.

I still have some minor enhancements to add to the published pages, but having finished the main functional coding I wanted to take the opportunity to make a posting while the thoughts are still fresh, and also to break the dearth of postings so far this week. Tomorrow I lay down my coding tools and return to my preferred role here as writer and publisher.

posted by Phil 2:52 PM (GMT) | comments | link

Building a website using plug-in online services: the Loosely Coupled experience

read an RSS feed from this weblog



Loosely Coupled weblog RSS source


Copyright © 2002-2006, Procullux Media Ltd. All Rights Reserved.