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 updatestats.
The updatestats 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 updatestats 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 13, 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/local/bin/updatestats
In Wacs 0.8.6, 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 there's a new blogging feature in WACS and the first thing to make use of it is none other than updatestats .
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.
With the addition of the blogging feature in updatestats 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 updatestats 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 #CGIURL# style substitution variables
before being stored into the database.
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.