Matt Mullenweg mentioned earlier today a plugin/application combo that displays a system tray popup on Windows whenever you have comments awaiting moderation. He also expressed a desire to see something like that for OSX. I thought it’d be nice too and given the lovely weather, I had some time on my hands.
The file linked to below contains a python script which connects to your WordPress installation and uses the HowToGeek – WP Notifier plugin to check for any comments that are awaiting moderation. If any are found, the script uses Growl to notify you that they’re waiting. Full instructions are included in the .ZIP file and below. Let me know if there’s anything you think can be improved (or fixed).
Download WordPress Comment Moderation Notifier for OSX
Requirements
You must have the HowToGeek – WP Notifier plugin installed.
Installation
Install the python Growl library provided in the .ZIP file.
cd growlpython setup.py buildsudo python setup.py install
Now that the Growl library is installed, tweak the configuration values to your liking at the top of wpcmnosx.py. Move the script to your favorite location.
Configuration
There are a number of configuration variables listed at the top of wpcmnosx.py. This is what they mean:
XMLRPC_LOCATION: The location of your xmlrpc.php file. Should be something like http://example.com/wordpress/xmlrpc.php or http://example.com/xmlrpc.php.
BLOG_ID: The ID of your blog in WordPress. The default value of 1 is probably ok.
USERNAME: A username with the moderate_comments privilege.
PASSWORD: … and the password
NOTIFICATION_INTERVAL: The amount of time in minutes to wait between checking.
DAEMON: Whether to put the script in the background after executing.
Execution
To execute the script, run python wpcmnosx.py from the command line.
If the script is configured as a DAEMON, you will get your command-line back immediately and the process will continue running in the background. The process id of the process is written to the `~/.wp_comment_notifier.pid` file. The process can then be killed using `kill`
Precautions
Your password is stored in cleartext in wpcmnosx.py. You might want to chmod it to 700. Also, as mentioned by the author of the HowToGeek – WP Notifier plugin, the username and password are sent in cleartext if you don’t use SSL in the XMLRPC_LOCATION configuration setting.
[Update: Also available using AppleScript]
[Update: Now supports other notification methods and multiple blogs]
This is just great!
Hopefully somebody will port it to Linux as well… and also make it work for multiple blogs.
There’s no reason why the client piece couldn’t support x number of blogs, I just never got around to that in my C# windows client.
What The How-To Geek said. Tweak it to work with multiple blogs and make a port for Linux (which shouldn’t be so hard since python and Growl works here – at least with Ubuntu) and this notifier will be a killer app for all blogers.
Lovely! This is quite useful, thanks.
Wow, this totally calls for a WordPress OAuth plugin…!