Software

Baen Ebook Index

This code is based on what I use to manage all my eBooks.

I have rather a lot of Baen eBooks so getting an index that (mostly) fits on one page was a pain. Especially since I wanted to have the eBooks sorted by author/editor and because I discovered I had various duplicates. I suspect that these problems are not unique to me so I am providing here a slightly tidied up version of my files. The software consists of a clever piece of DHTML/Javascript which displays the index and a perl CGI script to create it.

Requirements: A web server and perl. Since I have a web server running on my laptop (I use Xitami if you care) I access my books via http://localhost/... rather than the more common file:///c:/... style methods but with a bit of tweaking on the CGI script you can omit the web server requirement. However in order to (re)index the file you will need perl to run the script unless you decide to rewrite it in a different scripting language.

Installation: Download the ZIP file and extract the files. Put the index.htm file in the root directory of your ebook collection and the updateebooks.cgi file in the web server's cgi-bin directory. If the ebook directory is not [c:]\ebooks\ then you will need to edit the cgi file appropriately.

To replicate my settings (books in c:\ebooks\* reached by http://localhost/ebooks/ you need to add the following line in the [Alias] section Xitami's defaults.cfg file

[Alias]
    Ebooks = "c:/ebooks"
if you are using Apache then appropriate directory and alias directives are required to be added to httpd.conf and likewise for other web servers. The Apache settings are:

Alias /ebooks/ "/RealPathToEbooks/"

<Directory "/RealPathToEbooks/">
   Options Indexes MultiViews
   AllowOverride None
   Order allow,deny
   Allow from all
</Directory>

The file is saved in DOS format. If you are using UNIX or Linux (or Apple MAC?) you may want to do a do a dos2unix to remove trailing ^Ms on each line of updateebboks.cgi. In addition you may also need to change the #!perl to #!/usr/bin/perl (or wherever perl is on your system) in non microsoft environments.

Usage: Before you can use the index you will need to run the indexing script - http://localhost/cgi-bin/updateebooks.cgi if you install it in the standard location. This will produce a lot of fairly cryptic output followed by a link to the updated ebook index page - probably http://localhost/ebooks/index.htm. When you open that page you should see a list of authors such as the one below arranged in a number of columns:

Aaron Allston

If you click on an author then the list of books you have for that author is shown as below:

Aaron Allston

If there are duplicates of a particular title then the second and subsequent copies are indicated by *s and if you click again the list is closed.

When you have downloaded new ebooks just click on the update link at the bottom to reindex your collection.

Finally, you can modify the width of the columns so that you can get more of them to fit on the page. The default (200) seems to work well for most uses.

You can download the ZIP file containing the blank HTML page and the CGI script and there is also a sample page for you to look at (clicking on the links won't actually get you to the books). Please report any bugs or feature requests using the email address on my contact page.

NB Minor updates to ZIP file on 28 June at 1810GMT and a release of v1.1 on 29 June

Creative Commons License
This ebook index is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Site Home and Software Home