Squashing Link Spammers in Movable Type

I'm finishing a new book, Movable Type Bible Desktop Edition, by covering the subject I've been most eager to cover: plug-in programming.

As you can do with UserTalk scripts in Radio UserLand, you can write scripts that enhance the functionality of Movable Type. The software can be extended with Perl scripts that are executed by placing HTML-style tags and attributes in templates, the same technique employed by the software itself. The script output appears in the rendered file.

Plug-ins also can filter text on any Movable Type template tag. I wrote one this afternoon that tackles an obnoxious form of comment abuse: Posting a bogus comment packed with spam links.

The RemoveExcessiveLinks filter sets the number of links you're willing to tolerate in a user-submitted comment. When a comment hits or exceeds the number, all links are removed from the comment.

To use it, place the RemoveExcessiveLinks.pl script in Movable Type's plugins directory. Use it with a tag by adding a remove_excessive_links attribute with the number of comments to trigger your wrath, like so:

<MTCommentBody remove_excessive_links="5">

With this example, any comment with five or more links will be sanitized to remove all of its links.

Comments

Which is better in your opinion? Word Press or Moveable type? (hope i got the names right) Coz i really need to get the best blogging software i think.


Many thanks

_______________
Help Desk Software

I've been using a plugin called MT-Blacklist to do something similar to this. I'll employ your plugin to help out!

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).