So I have enabled the [[plugins/moderatedcomments]] plugin on my wiki. and good thing that! around 1000 spammy comments showed up in the last 3 months! Awful!
2015-07-23 23:03:14 +02:00
It's pretty hard to figure out the ham and the spam in there. One thing I was hoping was to use the power of the commandline to filter through all that stuff. Now, it seems there's only a "ikiwiki-comment" tool now, and nothing to examine the moderated comments.
It seems to me it would be great to have some tool to filter through that...
So it turns out it was over 3000 comments. The vast majority of those (every one but 42 comments) were from the IP `46.161.41.34` which i recommend null-routing everywhere. I used the following shell magic to figure that out:
Another update, 2020: I rewrote the script to support interactive batch approval and running from a cron job. I have published the [script in my own repo](https://gitlab.com/anarcat/scripts/blob/master/ikiwiki-comment-moderation) since it's python (and not perl), but I would be happy to provide it as a patch here if that's acceptable.
The basic usage is as follows. First, you add the script in a cron job:
This will run every hour. When there are no comments to moderate, the script is silent and you will not get mail. Otherwise you will get something like this:
date ip user subject content
2020-05-27T03:42:05Z 192.168.0.116 spammer name subject spammy comment
1 comments pending moderation
Then you can either go through the web interface to approve/deny the
comments, or call the script by hand, interactively, for example:
moving /home/w-anarcat/source/.ikiwiki/transient/blog/2020-04-27-drowning-camera/comment_1_07f43231a14d0ee6e78d1030aa6a7985._comment_pending to /home/w-anarcat/source/blog/2020-04-27-drowning-camera/comment_1_07f43231a14d0ee6e78d1030aa6a7985._comment
And you're done! In the above case, the test comment was actually
approved (by pressing `a`), but you can also hit `d` to just delete
the comment. The default (`i`) is to ignore the comment.
I find that this is generally faster than going through a web browser, although to be as fast as the CGI interface, there would need to be a final dialog that says "delete all ignored comments" like in the CGI. Exercise for the reader or, I guess, myself when I got too many junk comments to process...