bookpicker

Usage

bookpicker

Description

This simple script is a result of my effort to bring some order and discipline to my personal reading. I was buying books without reading them. Long, challenging, books were especially discouraging. (I'm thinking about Infinite Jest by David Foster Wallace.) I also have reading "projects": an effort to read a number of specific books in a specified order (for example: all Dick Francis's mysteries).

Hence this script: given one or more text files containing zero or more lines, it will "pick" the book at the top of one of them. Choosing between lists is random, but weighted by the number of the lines in each list: a list with 10 books is twice as likely to be picked than one with 5 books.

There's nothing about the script that depends on the lists containing book data. The weighting algorithm is simple and generally useful, if you generally do this kind of stuff.

This script is a cornerstone, surrounded by some simple made-up "rules" about library books and just-purchased books. (I can read them right away.) All in all, it's been a good influence.


Source

Back to Hacks


Last modified: June 20 2003 15:03 EDT

Paul A. Sand, pas@unh.edu