1.5. How paperboy Works: Beginners' Version

Now that we've gotten through the preamble, let's talk about how paperboy works. This is a basic discussion, a more detailed description is provided later on for those who are interested. If you don't care for this kind of discussion, you should be able to skip it and understand the rest with little difficulty. Though if you want to get the full power out of paperboy (especially if you want to hack it), you should keep reading.

The paperboy base program is simple to understand, it's job is to take the whole download/parse/transform/output process and perform it as one step for the user. The whole process paperboy goes through is outlined here:

  1. Parse command line options passed to paperboy.

  2. Download files, caching old versions as necessary for deciding if something "is new" since the last update.

  3. Register XSLT functions (program and user defined).

  4. Apply XSLT templates to the downloaded files.

  5. Output the parsed result.

Three libraries are used to do much of the work and will be discussed in the next section. To use paperboy you'll need to have XSLT templates to get the output format you want, which means you'll either have to learn XSLT yourself (which is easy if you already know XML or HTML) or you'll have to find them (some examples are included in this manual and discussion of places to check is further on).