Automatic Collection Maintenance Tools

These tools are designed to be run automatically, typically on a nightly basis, to keep parts of the system up to date. The main task at present is to keep model statistics up to date, and this is the job of wacsupdstat.

The wacsupdstat Command (formerly updatestats)

The wacsupdstat command is there to ensure that a model's record is kept up to date with respect to the sets she is associated with. This is done because the model record actually keeps some basic statistics about the sets, number of images and video clips and types of activity featured in those sets in order to better describe the model and her activities (on camera). Of course, much of this information is ultimately derived from the sets she features in; for instance, if she features in a lesbian set, the assumption is that she does lesbian scenes on camera! Obviously examining every set each time a model page is loaded is unlikely to be very practical, so the schema design has this data cached within the model record.

Generally wacsupdstat needs to be run after each time updates are made to the Wacs collection, but in practice it's probably easier to simply configure it to run once per day. To do this we once again make use of the cron timed execution facility (described in the section called “Configuring Automatic Download” of Chapter 14, The Download System). In this example, it is being set to run at just after midnight (modulo the advice above about making sure the machine will be likely to switched on at that time):

% crontab -e

and add the following line to the entry:

15 0 * * *      /usr/bin/wacsupdstat

In Wacs 0.8.6, wacsupdstat (back then called updatestats) was upgraded to produce a summary on the standard output of what has changed. It mentions who has new sets, new types of sets and what totals they've now reached - this is a nice management summary for the in-house team. In fact, we decided it was so useful that is should be possible to share it with the wider user community. As a result in WACS 0.9.0 onwards there's a new blogging feature in WACS and the first thing to make use of it is none other than wacsupdstat.

The blogging feature is not enabled by default, but if you add the line: <updatestats>blog:notes</updatestats> to the layout section of the main wacs configuration file each time updatestats is run (and finds changes of course), it will post it's update report as a blog entry as well as emailing it to the WACS site administrator.

The wacsblogctl Command

With the addition of the blogging feature in wacsupdstat in Wacs 0.9.0, facilities were needed to manage the blog entries which would otherwise grow rapidly. Additionally the user interface to reading the automatic blog entries created by wacsupdstat also provides for feature articles as well as simple blogs. There also needed to be a way to create these. This is all provided by the new wacsblogctl command.

wacsblogctl supports three main modes of operation in the initial version in Wacs 0.9.0 - --dump for exporting blog entries, --load for creating them from an HTML file and --purge to clean out old entries from the blog database. The --dump operation takes one more argument, the record number of the first record of the blog - the blog entry will be written to a file called blog-B-12.html where blog entry no 12 is a standard (B-type) blog entry.

The second operation, --load needs at least one more argument, the file name to read. It can also take --feature or --article which specifies it's an article and increases it's active life to three months instead of just one. A corresponding --blog specifies it's a standard blog entry (the default for now). You can also specify an author with the --author= option. The file that you load is a very simple HTML page and can be created with any standard HTML editor/composer of your choice. The first line up to a >p< paragraph break mark is assumed to be the title. The rest of the document is considered to be the body of the blog. If you include references to standard WACS icons (probably via dragging and dropping in your HTML editor), they will be condensed into the more portable #WACSMTHU# style substitution variables before being stored into the database.

To help clarify this, take a look at this example blog entry HTML document:

Example 17.1. Sample Feature Article HTML Document

<html>
<head>
<title>Output of my HTML editor</title>
</head>
<body>
<b>Teen Beach Babes</b> by John
<p>
<img align=left src="#WACSIMG#/std343.jpg">Join our gorgeous model
<a href="#WACSMTHU#/23">Sarah</a> and all her friends down on
the beach peeling off their colourful bikinis so their lovely bodies feel
the warmth of the sun all over.
Come over to <a href="#WACSILIST#/cgroup=12"> for our best seaside
sunshine fun!
</body>
</html>

You note we've used the #WACSIMG# method here, but you could just as easily drag and drop images and links from an open web browser (assuming your editor supports that) instead - just make sure you've switched OFF usedirect mode in the Preferences program first. Now assuming you've called this file beach.html, you would use the following to make it into a feature blog article:

wacsblogctl --load --feature --author=John beach.html

The final operation, --purge simply deletes those standard blog entries that are now pasted their expiry date. If you also want to delete old feature articles, then add --all after the --purge command.