Maintaining lists as web pages

I wrote this in response to a query on the excellent Web Tools Review .

Well, I guess making a fool of myself on the web appeals to my ego somehow. Consider this a start on my large debt to people who publish free software.

I find that when I'm learning a new programming language or way of thinking it helps a whole lot to have some example code to work from. So I looked at your document and thought about how I'd go about maintaining such a list.

If I were publishing a document like your search.htm, I'd put the URLs and engine names in a database. That would add an extra layer of complexity to the examples, so for the sake of example I put them in a couple of text files, named: awards.txt, engine.txt, exchange.txt, general.txt, misc.txt.

Hand-waving follows, let's just say with a little editor massaging (I used emacs, if you were patient the Windows notepad.exe would work just fine) I pulled your .htm file apart and ended up with those files, each with the URL then a text description of the service. Now the first couple of lines of "engine.txt" look like:

http://www.whatsnew.com/whatsnew/
 What's New
http://www.infoseek.com
 InfoSeek
http://www.excite.com
 Excite
http://www.hotbot.com
 HotBot
http://www.lycos.com
 Lycos

Then I whipped together as simple a Perl script as I could that would run through each of these files and output an HTML file. It would be relatively simple to hack this script to produce exactly your output, I did an easier form for the sake of expedience, and because the whole point is that you want to rebuild the output in different forms without wading through huge HTML files.

That script is at http://www.flutterby.com/archives/1998_May/makepage.html because I didn't know how badly Philip's automatic HTMLifier would mangle it if I posted it inline here. It's heavily commented, hopefully with a Perl book beside you you can understand what it's doing, copy it into a local file and start hacking from there.

So if you wanted to have someone use a simple text editor to maintain those various text files for each category, then just tweak this script a bit when you wanted to output a different looking list, this would be a cool place to start.


Wednesday, May 6th, 1998 danlyke@flutterby.com