« The Shape of the Universe | Main | Lambeth Update »

October 14, 2003

Spam Traps for MT and Typepad Blogs

***Dave asked the question about what to do with blog spamming. So far, blacklist management has been the only answer. I have a solution that unless the spammer is very persistant he will have to manually enter comments on your blog.

First you will need to create a spam trap blog. Create an entry that will accumulate spam messages. Look at the source of that entry and write down the entry_id. The HTML will look like this:


<input type="hidden" name="entry_id" value="398723987" />

This ID will become the entry_id for all your comment forms. For my examples this will be spam_id. Replace spam_id with the number of the spam blog entry. New lines in the examples below will be in bold and modified lines will be in italic.

For MT blogs you will need to create a new index template with the file name obscure_script_name.js. In this template you will put the following code:

function doLoaded1 () {
    document.comments_form.entry_id.value = obscure_variable_name;
}
onload = doLoaded1;

For the individual archive itself:

<head>
<script type="text/javascript" src="<$MTBlogURL$>obscure_file_name.js"></script>
</head>
...
<script type="text/javascript" language="javascript">
...
var HOST=....
var obscure_variable_name = '<$MTEntryID$>';
...
<form ...>
<input type="hidden" name="entry_id" value="spam_id" />

For Typepad the obscure_file_name.js template changes slightly to this:

function doLoaded1 () {
    if (!document.comments_form) return;
    setFormValues(document.comments_form);
    if (document.comments_form.author.value)
        document.comments_form.bakecookie.checked = 1;
    document.comments_form.entry_id.value = obscure_variable_name;
}
onload = doLoaded1;

The individual archives look like this:

...
<head>
<script type="text/javascript" src="<$MTStaticWebPath$>comments.js"></script>
<script type="text/javascript" src="<$MTBlogURL$>obscure_file_name.js"></script>
<script type="text/javascript">
hostName = '<$MTBlogHost$>';
obscure_variable_name = '<$MTEntryID$>';
</script>
</head>
...
<form ...>
<input type="hidden" name="entry_id" value="spam_id" />

Further cloaking can be done by having a .php program generate the javascript. To see how innocuous this looks, click on the permalink of this post and show the HTML source.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d834558a7f69e200e5501dccfd8833

Listed below are links to weblogs that reference Spam Traps for MT and Typepad Blogs:

» Color Picker, Another Comment Spam blocker, Cool Counter Script from scriptygoddess.com
Catching up on a few things people sent in... Javascript Color Picker Version 2.0 can be found here - cleaner code, improved API, and better examples. Sent in by Lloyd Dalton - daltonlp.com Another Commend Spam Blocker Spam Tramps Sent... [Read More]

Comments

Seems like a good idea to me.
Spam bot won't have a chance with that!
But there are still manual spammers, guess there is no "traps" for this kind...

I think links on blogs will not be counted anymore by google, just like guestbooks. I've been watching some sites that had hundreds of links from weblogs. Now google displays only a few links to these sites when you seach for backward links.

<<< Also google said that in the future expired domains that still have links on dmoz and other sites will lose those links when the domain expires !!!!!!!!! >>>

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Comments are moderated, and will not appear until the author has approved them.