Further to my earlier (and popular – thanks Shaun) post about Despamming Shortstat, I’ve made a small update to the code that has a few improvements on the original:
- It now only looks for entries added to the MT-Blacklist database made in the past 72 hours (you can change it if you want). The comment spam blacklist is constantly very similar to those referer spamming, and so only checking recent additions reduces the execution time dramatically and (for me) seems to be just as efficient.
- The script chucks out a brief summary of what spam domains it’s removed.
- It also uses a couple of variables from your ShortStat configuration file, so it really should just drop in and play nicely.
- You could probably set this as a cron job now, changing the 72 hours to fit the time of your job.
It’s now a few more lines than the original (well, it’s not that many, but I was rapidly getting toward a homepage full of scripts) so you can view the code right here instead:
Mark, thanks for the code for the de-spamming, that is awesome!
I am getting an error though, not sure it’s in the code or in my server settings.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource on line 26
Any ideas?
Thanks!
I made some changes to ShortStat. I don’t call it through a PHP include but through some Javascript. Gone are the spammers without any need for de-spamming
Check it here:
http://www.i-marco.nl/weblog/archive/2005/04/05/improving_shortstat