Flat files, Emacs, CVS, and a Blog integrate to make a simple contact management system.
We spent a while looking for a decent system that would let us record contact details, notes of discussions, and pending actions. Surprisingly, we didn’t find one. So this afternoon I wrote one. It’s an interesting hack, and so far it’s looking fairly usable.
We now keep each person’s details in a flat file, one per person, all under CVS. That way Andy and I can share and mutually update all the information. The flat file is a convenient insurance too: any tool can read them, so we’ll always be able to add functionality. And, if we eventually decide to move up to something grander, converting from the flat files should be simple.
The flat file has a header consisting of "field: value" lines, where the part before the ":" is the field name, and the part after it is the value associated with that field. This is where we keep the contact information (addresses, phone numbers, and so on), along with status information and flags fields. If someone works for a book store, for example, we’ll have:
Categories: Bookstore
After the header is a series of notes in ChangeLog format (that is, a header for each day, followed by a bullet list of the notes for that day).
I wrote a fairly simple Emacs mode to support the file. If you create a new contact, Emacs populates it with a template for the header. In all contact files, a simple keystroke generates a new note entry with the right date stamp and in the right place in the file.
Finally, I added an input converter for RubLog, so that it now understands the contact file format and displays it nicely in the blog page. This is a nice hack for a number of reasons. First, it means that we have a simple way to see recent activity: the blog automatically brings freshly touched contacts to the top of the front page. Second, because RubLog automatically hyperlinks, you can link between contact entries by just typing the name of the target as a WikiWord (see the Fred Bloggs example below). You also get external URLs and the like for free. And third, of course, is the fact the RubLog can read straight from a CVS repository, so it always shows us the most up-to-date stuff.
For example, the entry below was created using the Emacs mode and checked into CVS. Click on the hyperlink FredBloggs to see how it formats in the blog.
Name: Fred Bloggs
EMail: f.bloggs@dont.email.me
Title: Purchasing Manager
Org: Big Bookstore, Inc
Address1: 123 Main St
City: Somewhere
State: OH
Zip: 12324
WorkPhone: 555 1212
FaxPhone: 555 2121
Categories: Bookstore
Notes:
2004-01-07 Dave Thomas <dave@not_pragprog.com>
* Called them. They liked the package and ordered 500 of each book.
2004-01-05 Dave Thomas <dave@not_pragprog.com>
* They called to ask about bookseller programs. E-mailed them the
standard package.
Action: call on 2004-01-07
It’s early days, but I’m pleased at the way these various trivial technologies have combined to create something useful.




Comments