Thursday, 3 February 2005
It seems the spammers noticed I have enabled trackbacks on this weblog. As of last evening some spammer started advertising for some personal injury lawyers. If there is one thing I hate more than spam, it’s personal injury lawyers. The solution: a spam filter for trackbacks.
I already started using Pivot-Blacklist for Nucleus a while ago. So, instead of creating a whole new spam filter I modified both the Trackback plugin and the Blacklist plugin in such a way that they will work together.
The existing blacklist works based on notifications. Basically, each plugin can subscribe to many different notifications, but in this case one of them in particular:
PreAddComment. Every time a new comment is submitted by a user, the
PreAddComment notification is send out to the Blacklist plugin. The plugin takes the notification and checks the data submitted by the user for spam.
Notifications are not limited to Nucleus itself though. Other plugins can also issue notifications. And that is what I decided to do. The modified Trackback plugin now sends out an new notification called
The Blacklist plugin was modified to look not only for the original
PreAddComment notification, but also for the
In total, maybe 15 lines of code and all my trackback spam is gone. I hope to have some time later today to publicly release the code, so other can benefit. I am going to include my modifications in the next release of the Trackback plugin for sure. Ideally the Xiffy would also include support for the
PreAddTrackback notification in the next release of his Blacklist plugin.
Update: Apparently Xiffy already started working on providing blacklist checking for other plugins.