Hiding Spam Comments

Thanks to an article from SANS ISC, I have been working for the past two weeks on a new spam-reduction technique for WordPress.

It’s really simple, only 2 lines of code, really.
The first is in the comments.php page (if your custom theme doesn’t have this file, use the one from the default theme).

Around line 80 (right before the comment author, etc. fields), I added the following line:
<input type="text" name="subject" id="subject" value="" size="22" style="display: none;" />

On wp-comments-post.php in the blog home directory, I changed the following line:
$comment_id = wp_new_comment( $commentdata );
to:
if(empty($_POST['subject'])) { $comment_id = wp_new_comment( $commentdata ); } // execute comment if "subject" field is empty

Since the “subject” field has the display:none; style, it is hidden to the regular blog reader. But, most comment spam is performed by bots, and not people. The bot will “see” this field and populate it with data.

Since this field now has data, it is not empty, and the actual commenting action will not happen.
All this from one extra line of html and a single “if” statement.

I decided to let both mine and Sonny’s blog run for a week, so see how much spam we got, then to “turn on” the new spam filter and see how much spam we accrued in a week.

I started at 12:30pm on 11.08.06, with both blogs using a plugin called Akismet which would “tag” the spam, but not delete it.

One week later (12:30pm, 11.15.06), I had accrued 201 spam comments, while Sonny on the other hand, racked up 1423 spam comments. Today, one week after the initial measurement, I had 10 spam comments, compared to Sonny’s 953.

Why were my numbers both before and after so much lower than Sony’s? I don’t know. I’m guessing it has to do with cached pages. Either way, the reduction is significant.
And down the road, as bot writers may/may not pick up this method, you can specify the hidden attributes as a CSS style (in the header or something, called “form”, for example), and class=”form” the hidden input, or maybe even apply the style to a div or span tag that wraps around the input, etc., etc.

Anyway, I’m going to start building this functionality into other web apps I write. Hopefully you’ll do something along the same lines.

Zombies and Football.

No, this isn’t a comment on America(ns) as a disconnected (or overly connected) society or anything equally over-written or potentially self-aggrandizing. There is an actual link (as much as one can make, I reckon).

Yesterday, there was a certain point late in the third quarter of the Saints/Steelers game that I totally lost interest. No, It wasn’t due to Reggie’s fumble (although he did have that spectacular touchdown earlier), it was Richard. No, his real name isn’t Richard, I’m just using it to protect the living, for what it’s worth.

Richard, it seems, snapped yesterday. Long story short, he got in an argument with his girlfriend, shot the dog, and sat in his house in a standoff with the NOPD and its SWAT Team for about 5 or 6 hours yesterday afternoon / evening before eventually peacefully surrendering.

Richard is (was? I mean, he shot the dog.) a friend of mine, a guy I would shoot pool with regularly. And I just learned that it was the roommates’ boyfriend’s pit bull, not his dog “Ozzie”. Apparently the pit had a habit of attacking both Richard and Ozzie.

We spent a number of hours wondering if our friend was going to be alive or dead at the end of the day. We just didn’t know, and we knew that there wasn’t one thing we could do about it.

Things are just off here. I really don’t know how to properly, much less succinctly, put it any other way. In the span of a couple of weeks, we had the whole Zack and Addie murder/suicide, Bucky’s suicide, and now Richard. All people I knew. Many of us (at least I am) are burning holes in the bottom of our pint glasses wondering “Who is next?”

It would seem children, that there is no end in sight. It’s a sort of a “one foot in front of the other” situation. One day at a time.

So, it’s really no wonder that last night I dreamt of zombies. My subconscious needs a rest, methinks. Hello? Captain Obvious? Usually, I think I’d enjoy a zombie dream. It’s like a video game but much more immersive and real.

So, a quick recap of the dream, before I continue. I’m not sure where I am, but it definitely isn’t New Orleans. It’s a place I’m apparently familiar enough with, but not the Nolia. I can’t get home to get my guns or any other supplies, and I’m trying to round up everyone to ensure the highest rate of survival for as many people as possible. And while this isn’t NOLA, everyone from there is there.

One by one (or few by few), people get separated, lost. I can’t help everyone. I lose Kelly, I lose Jonah and Shannah, some people I went to high school with, some of my bartenders, and lots more. You get the idea, pretty much everyone. The overall theme? It’s eventual. One by one, bit by bit we go. No matter how hard you try, you are just going to lose some people. I keep trying, but eventually it’s just me on my own. Trying to help all, only able to save myself.

It’s not due to incompetence or a lack of ability, it’s just the situation. There is only so much you can do, the rest is up to others and the shuffle of the cards. That’s how it just is.

That’s pretty much it. Like I said, obvious, no real need for deep interpretation. It would just be nice to get restful sleep when it is really needed. And no need to worry kids, you know me. I’ll be fine. Sometimes, I just don’t really like “There’s only so much you can do.” outlook.

And the Saints lost. Damn.

“And I want to know
The same thing
Everyone wants to know
How’s it going to end?”
Tom Waits, How’s it going to end?

Biiiissssscooooooooo!!!!!!

So, it’s official, and I think I might have called it.

Basso is now a member of the Discovery Channel Cycling Team.

It’s so fitting that one of Lance’s biggest threats is now taking the helm of his team. Basso is a stand-up guy, and I’m glad he’s captaining “our” team.

¡Viva Basso! ¡Viva Disco!

Bucky James’ Second Line

Here is a video clip and some photos I took from Bucky’s second line yesterday:

Busy Tuesday and Bucky James.

Here is more or less my day today in chronological order:

  • work
  • vote
  • go to bank
  • work
  • look at house
  • help grandmother unload car from trip
  • work
  • second line in memory of Bucky James (starts at 4pm at the Spotted Cat)
  • Happy Talk show at the Circle Bar

That’s brutal.

In addition to the aforementioned Dexter, I have a new tv show. It’s a cartoon called Metalocalypse on cartoon network’s [adult swim]. It’s brutal.

According to co-creator Brendon Small, “The show is basically about a (half-American/half Norwegian) metal band (Dethklok) that is about a million times bigger than the Beatles. But a million times more dangerous and a millions times more stupid. This show promises violent murder. Violent violent murder. And metal.”

So go watch it on [adult swim] or pull it down through bittorrent and prepare to brutally laugh. If you don’t, you are dildos.

My brain is fuzmy.

My morning was looking up. I felt awake and alert. Ready to be productive.

Then I took a hit of the Robotussin, to help with the removal of phlegm left in my lungs from my extended weekend sickness.

Well, that was dumb. I feel fuzzy, and I still have work to do. Blargh.

Well, barring evening fuzziness, Lara, Sonny, and I will ride in the Sorry Bout Ya Face ride, a benefit for what I assume is a cyclist who got hurt.

Oh, and at midnight at Molly’s is the great can opening. That is all for now.