Tuesday, December 9, 2008

Fun with Wordle




The above graphic is a world cloud representation of a day's worth of searches at Carmel Clay Public Library. The image was generated using wordle (http://www.wordle.net/). Using wordle, you can paste in a series of terms, and generate the cloud, showing which terms are more commonly used. There are many options for arrangement, color, etc.

Obtaining the search terms was relatively easy on our SirsiDynix GL3.1 ILS. First, I edited our system.env file and added the following line:

USAGE_LOGGING|1|
1 turns logging on, zero turns it off.
This turns on usage logging. The log files can be found in /s/Sirsi/Unicorn/Webcat/Logs and are n the format of 20081209.weblog for the 12/09/2008 logfile. Unfortunately, the log file is mostly garbage:

2008/12/9 03:47:34 UFSQuery: "GENERAL halo" Session: 296070012 Server: 1home Records: 49
2008/12/9 03:47:35 UFSQuery: "GENERAL archaeology as human ecology" Session: 210950013 Server: 1home Records: 02008/12/9



What can we do to make this more useable? I decided to write a simple Cold Fusion script to process this data, removing all the extraneous information so that we'd end up with a list of words. The following code is a brute force method of doing this -- by simply looping over the list, it removes un-needed data:





The code can be modified for a different file path, or increase the loopcount from 5000 to however many lines exist in your logfile. Once this has run, you will be left with a file of words. Simply open that file, past it into wordle, and you've got your graphic!

No comments: