MT Rebuild Script

My main blog page has a some sections that change with time whether or not I post. One of these is the Inbound section, which tracks inbound links by periodically querying technorati. The other is the new Listening To… section, which updates whenever I listen to music on my personal mp3 server.

Since these can update more frequently than I post, and since Movable type serves static, compiled, pages, I was looking for a way to automatically rebuild my main page. Seek and ye shall find. Thank you Erik for the sample code. I’ve tweaked the last few lines of your script so that it only rebuilds the index pages:

Before:


$mt->rebuild(
BlogID => $blogid,
EntryCallback => sub {
$i++;
printf “%d/%d – %sn”, $i,
$total, $_[0]->title if $report;
}
) or die “ERROR: “, $mt->errstr;

After:


$mt->rebuild_indexes(
BlogID => $blogid
) or die “ERROR: “, $mt->errstr;