Referral spam and comment spam

Aaron posted some useful information on how to get rid of comment and referral spam. I'm not using Wordpress, so I am unable to use the AuthImage plugin, but I made my own filter that basically just checks words and counts hrefs, rejecting comments that have too many of them. I also have a word filter for my referral list script, but it looks like the .htaccess method is better.