Rebuilding Movable Type Entries by Cronjob

Thanks to a tip from Richard Eriksson, I've completed the Movable Type utility to close comments and trackback on all weblog entries after they become a week old. I will be releasing it tomorrow under the GPL, assuming it runs properly as a cronjob and closes these seven-day-old entries to new feedback.

I couldn't get the script to work until I used Timothy Appnel's mt-rebuild utility to republish individual entries after they have been closed.

I tried to use Ed Dumbill's excellent XML-RPC for PHP library to rebuild entries, calling the mt.publishPost method for each entry, but couldn't get the calls to work.

I run mt-rebuild from PHP with the language's system function:

system("$this->perl_path $this->mt_rebuild_path -mode="entry" -blog_id=$entry_blog_id -entry_id=$entry_id");

The $this->perl_path and $this->mt_rebuild_path references are object variables that hold the locations of Perl and mt-rebuild.


I found your entry while researching how to use XML-RPC to rebuild my posts. Calling mt-rebuild sounds even better. Thanks for the post!

For clarification, should pearl_path and mt_rebuild_path simply be replaced with the actual paths for my server?

Also, I believe the " in mode="entry" actually need to be ' so they don't conflict with the PHP enclosure.

Add a Comment

All comments are moderated before publication. These HTML tags are permitted: <p>, <b>, <i>, <a>, and <blockquote>. This site is protected by reCAPTCHA (for which the Google Privacy Policy and Terms of Service apply).