November 4, 2004Suck it, spammersRunning my own website and blog is fun, but fighting the war on spam is a difficult one. Believe it or not, we have to fight off a lot of comment spam; they'll use the comment system to post about the latest drugs, porn, and... um... drug porn. A lot of the spam shows up in old messages... I think the spammers are just trying to boost the Google ratings for their websites. There are a couple of counter-measures I've taken to stem the tide of crap. 1) I've installed MT-Blacklist, which prohibits comments based on specific strings of text. It can cause saving the comments to get a little slow, because it's checking to make sure there isn't any disallowed content. Other than that, it shouldn't trip anybody up, unless your first name is Levitra. 2) I've also installed the MT-CloseComments plugin. Comments on all entries will now close 10 days after being posted (once the entry falls off the front page). This shouldn't be a big deal, since if you do comment on something that old, nobody was going to see it anyway. We don't even get all that much traffic (about 150 visits per day, mostly friends), so I can't imagine how much of a headache this must be for people with blogs that people actually, you know, read. Figuring out how to get MT-CloseComments to work was tricky, so I'll detail that here in case any other intrepid Movable Type users need the technical info. OK, MT-CloseComments in its current form only works if you're using an SQL database to store posts/comments/etc. For example, some hosting providers allow you install MySQL, which is what we have here on Westhost. However, when I first installed Movable Type, I used the default database setting, which is "BerkeleyDB." This stored the post database in a subfolder of the Movable Type directory, which was fine, although using MySQL seems to provide for more flexibility in case you want to "get under the hood" and tinker with database entries directly. In order to start using MT with a MySQL database, you need to do this stuff: 1) Change the settings in mt.cfg. See the MT upgrade documentation for instructions on what to do. Basically, you need to be able to create a new database in SQL (e.g. "movabletype"), and you need to create an SQL account and password for MT. Then you'll place all that info in mt.cfg the way they describe. 2) An earlier upgrade release of Movable Type added support for MySQL, and included a CGI script called "mt-db2sql.cgi" that would automatically convert the BerkeleyDB stuff to MySQL. This wasn't in the release package I downloaded, so I had to look around a bit on the Internets before I could find it. Here's the code; you can just copy it into your MT directory as "mt-db2sql.cgi". I'm not sure why this script is so hard to find; I don't see why current MT v2 users shouldn't be allowed to use it for free, but then again maybe they want to try to force you to upgrade and pay for v3. Who knows. 3) Run that script from your web browser, and if it worked you'll get a success message. All your posts and comments and such are now in MySQL. You'll need to change your main index template to include a tag somewhere for MTCloseComments. Follow the instructions given in the documentation for that plug-in, and you're done! James - 12:05 PM |