POPFile skeleton API Example for Programmers

This utility is deprecated and no longer supported. It will not function properly with versions higher than 0.20.x. Users who wish access to POPFile's API should check out the XML-RPC module documented in the Wiki or for v 0.21.x of POPFile, consider directly accessing the SQL backend with your favorite language.

The skeleton.pl script is an example script showing how to interact with the POPFile API for commandline programs. The script is heavily commented and uses the same coding style as POPFile, in fact, major parts of the script were compiled by cutting and pasting code from POPFile itself. The intent of the example script is to help those interested in developing commandline scripts understand the basic API without delving into the more complex modules, like the UI and Proxies, that are not applicable to commandline programs anyways.

POPFile is an automatic email classification tool authored by John Graham-Cumming available from SourceForge.

Instructions for use

  1. Download the skeleton script;

  2. Insert your program logic into the code at line 185 of skeleton.pl

  3. Save the modified file under the name of your new program, e.g., demo.pl

  4. Your program should be run from the POPFile install directory just like POPFile itself runs. For development and testing purposes, it is strongly suggested that you set up separate development installs of POPFile to run your tests.

Sample Project Based on skeleton.pl

The following is a sample of project using skeleton.pl as the basis for the demo code. In this case, we are simply going to call POPFile's API to obtain all of the bucket names and their unique word counts and display those results to the screen. This is a very basic and simple example of using the API. See the example code at the link below to see how we added our few lines of code to skeleton.pl to create our demo program.

skeleton_pl.htm

 

A big thanks to Adrian Nicolaiev for pointing me to PerlTidy to display the code page. Thanks Adrian!

The POPFile API Calls

The POPFile project's source is heavily commented and is your best source for documentation on the public API calls. It is strongly recommended that you limit your calls to the public API only. Calls to private functions are likely to break as new releases come out. The public functions should be more stable and less likely to change.

About Versions of POPFile

Note that this version of skeleton.pl will not function properly with versions of POPFile earlier than v 0.19.0, the current release. Bleeding Edgers who are using POPFile code from CVS should exercise appropriate care that changes to the API in CVS versions are not incompatible with this skeleton code.

Copying

Copyright (C) 2003 Scott W. Leighton

Licensed under the terms of the GNU General Public License.

Contributed to the POPFile project under the terms of the POPFile License Agreement.


Back to POPFile Utilities