code » gutenPod v0.1

Introduction

This is a program designed to reformat long text documents in a format that is readable by the iPod Note Reader. It was originally written with Project Gutenberg in mind, hence the name.

The iPod Note Reader cannot display documents of more than 4Kb, so it is necessary to split text up if you want to read it all. In addition, the program provides hyperlinks between pages. You can read more about writing for the iPod here.

Using the program

From the command line

perl gutenpod.pl file1 [file2...]

Using the Platypus version

Drag and drop your text files onto the application icon that looks like this:

gutenPod icon

Directories will be created for each one as described below.

Details

The program takes any number of text documents as its arguments. It outputs a directory in the same location that has the same name as the document with .ipodnote appended, so gutenberg.txt goes to gutenberg.txt.ipodnote. Inside this directory are three-digit numbered files.

Rename the directory as desired, and copy it to the Notes directory in your iPod. Go to this directory and start reading at 001. You will notice that there are "previous" and "next" links on each page - these will take you to the previous and next pages if clicked.

Files

Enhancements

This would be a lot more convenient for people generally if it were online, they could point it at a Gutenberg document and it would grab it, convert it and return it as a zipped directory. That's a possibility. However, it seems difficult for me to grab a specific Gutenberg plain text file - the user would have to specify the URL. Or maybe they could just upload the file themselves and it would convert it, which would be a generous thing for me to provide. In that case, I'd probably convert the program to PHP, which would make the upload/download thing easier (I think).

The paragraph and formatting detection could be a whole lot smarter. Unfortunately, text documents don't keep to a consistent style. Perhaps there should be different options that can be set.

Notes

The first version of this was written on Friday 15 October 2004. All the usual disclaimers apply, I take no responsibility at all for any exotic way you manage to screw your iPod with this program if you choose to use it.

New icon added 2004/10/16, 1:00 PM