Battling Trackback Spam at the Typo Console

So I looked at my blog today and found 800+ trackback spams that Akismet had missed (typo bug?) and started to delete them manually.

Then I remembered the Typo console. A few Google searches later for the basic idea, and not being afraid to experiment with Ruby (my, it’s a logical language), I came up with a way to delete trackback spams based on Ruby expressions.

I’m including a list of commands I issued to eliminate 90% of the problem articles at the end of this article for others who might have the same problem. If you don’t like dirty words, skip it. Review the rules before you run them as it deletes data.

Next up – generating IPTables ban logs directly with similar queries.

And now, without further ado:

Trackback.find(:all, :conditions =>"blog_name='nice article'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Amateur%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%ambien%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Amoxicillin%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%anal %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%asshole%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%babes %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%blowjob%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%boobs%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%breast %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%breasts %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%buttplug %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%centerfold %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%cialis%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%clitoris%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%codeine%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%credit %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%cum %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Ephedrine%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%erectile%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%escort %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%fetish %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%fisted %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%flashing %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%fuck %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%galoponir%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%gay %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%hardcore %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%hentai%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%incest %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Lexapro%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%loans %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%meridia %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%mortgage%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%naked%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%naughty %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%nigger %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%niggers %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%nude %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%nudes %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%panties %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%paxil%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%penis%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%penthouse%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%pharmacy%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Phentermine%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%pics %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%polomurinureon%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%porn %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%propecia%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%propeciax%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%prozac%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%pussy%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%refinance %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%sex %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%sluts %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%soma %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%spanking%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Sucked %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Tamadol%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%tits %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%topless %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Tramadol%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%Tramdol%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%ultram%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%vagina%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%valium%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%viagra%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%xanax%'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt ILIKE '%xxx %'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"excerpt='nice article'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"ip='64.27.21.46'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"ip='82.166.248.8'").map{|t| t.destroy}
Trackback.find(:all, :conditions =>"ip LIKE '62.213%'").map{|t| t.destroy}