About -

About This Site

Technical Design

The technical design of this site is one of its most unique and interesting features. Weighing in at about 3500 lines of perl, the CGI scripts supporting the site are the result of about 4 months of development. Perhaps their most important feature is that the user rarely notices how deeply involved they are with the scripts, which is why we've created this forum for explaining how our site works and what it's doing.

The most noticable script behind our server is wookie.cgi, which appears in the URL for this page. On a regular web server, a request for a web page looks something like:

  1. Client sends request
  2. Server sends file
Our approach was to intervene between the first and second step, creating the file the server sends right at the moment it's requested. Using the de-facto standard of HTTP Persistant Cookies, we can tell if a web browser has been to our site before, and a unique ID of their previous session. Using that information, we can load their previous session's configuration from a berkeley DBM database on the web server and determine how the request is answered. A request for a page through our system now looks like:
  1. Client sends request
  2. Script begins
    1. Client's User ID is determined and their configuration is loaded
    2. Requested file is opened and parsing of special tags takes place
    3. Requested file is sent as regular HTML to the web server
  3. Server sends file
Adding this layer of abstraction has allowed us the ability to create dynamic web pages tailored specifically to the interests of the user. For example, our parser can (and is throughout this site) be told to only display certain parts of a web page to a certain age group. Another example is your first visit; did you notice that the main page had a short blurb welcoming you to the tutorial? Our interpreter is told only to display that on a user's first visit. In addition to user configuration, the interpreter can display different content to different browsers; for instance, for browsers that do not support tables, the scripts can be told to display a text version of the HTML table.

Significant work has gone towards supporting browsers that do not support cookies (most notably older versions of Lynx), however the current implementation does not correctly handle some situations. Although browsers that do not support cookies are statistically irrelevant, requiring a feature not part of the standards is poor form and will continue to be worked on as our software is revised.

The idea for wookie.cgi comes from a previous script Brent worked on for ThinkQuest '96 called awooga.cgi; however, even though they perform similar actions, wookie.cgi is almost a complete rewrite (about 8% of the code in wookie.cgi comes from awooga.cgi) building on the strengths and removing the weaknesses of the previous generation.


Our Food Database scripts, planner.cgi, counter.cgi, food_search.cgi, and add_a_food.cgi all use an mSQL 2.0.1 database of nutritional information based largely on the U.S. Department of Agriculture's Nutrient Database for Standard Reference, Release 11. The database stores information on the amounts of thirty nutrients. Unfortunately, only about ten of those nutrients can be expected to exist accurately in the database as time goes by, since additions to the database by users will be based on the NLEA "Nutrition Facts"-style food labels, which does not require many of the nutrients be listed that we track in the database.

The reference for the USDA database is:

U.S. Department of Agriculture, Agricultural Research Service. 1996. USDA Nutrient Database for Standard Reference, Release 11. Nutrient Data Laboratory Home Page, http://www.nal.usda.gov/fnic/foodcomp


The Nutritional Profile Generator, profile.cgi, is one of the few scripts allowed to edit the user's configuration. Using information used with permission from The Science of Obesity and Weight Control and Recommended Dietary Allowances, 10th Ed., profile.cgi calculates your Recommended Dietary Allowances (RDAs), your approximate caloric intake (and as a result, your approximate fat, saturated fat, carbohydrate, and protein intakes), and your Body-Mass Index. All information is then saved into the user's configuration, and can be used by our other scripts to help customize the site. For this reason, most pages include an encouragement to go to profile.cgi if the user's profile is marked as not being set up.

About Our Images

All images on this site were created with The GIMP, a FREE and extremely powerful image manipulation tool. Although it started off as an attempt at a free clone of Photoshop, the GIMP has come to hold its own against any other professional image manipulation software package.

About The Authors

Brent is 17 and enjoys beating his own records. He attends the Thomas Jefferson High School for Science and Technology.


Jhenya is 18 and enjoys the outdoors and rollerblading. In the fall she will start school at
Mount Holyoke.

Alex is 17 and enjoys computers. He starts school at Rostov University in the fall.