Ajaxorized

Another creative way to prevent bots from stealing your email addresses

January 15, 2008

The following code (using prototype) prevents bots stealing the emailaddresses used on your website. Instead of including the emailaddress directly, use a div with a classname where the email-address needs to be placed:

Hi Bot! My email address is  <div class = "email_here"></div>!! Catch me if you can!

Then, use javascript to replace the email address after the page is loaded:

$$('.email_here').each( function(e) {
  e.update('willem'+'@'+'ajaxorized.com').observe('click', function() { window.location = 'mailto:willem'+'@'+'ajaxorized.com'; }).setStyle({cursor:'pointer'});
	});

Mind the concatenation that is used to prevent stealing from your javascript file. Include this piece of code in your body onload event and no bots will ever steal your email addresses again!

Add to: del.icio.us Reddit Slashdot Digg Facebook Technorati Google StumbleUpon Windows Live Yahoo
topFiled under: Uncategorized, Ajaxorized, Javascript, HTML | Willem @ 6:00 pm |

3 Comments

RSS feed for comments on this post. TrackBack URL

  1. if i was bot writer i would log everything that is not right email, but got ‘mailto:’ text. I think you should hide that(even be adding it char by char, but simple encription would be much more cool)

    Comment by raveman — January 15, 2008 @ 9:13 pm

  2. Hi Raveman,
    You’re right, to trick the bots you can be as creative as you want to be. Something like this will mislead the bots as well:

    ‘:otliam’.split(”).reverse().join(”);

    It splits :otliam into an array, reverses the chars and joins it.

    Comment by Willem — January 16, 2008 @ 1:38 am

  3. When I’m not lazy I use something like this:

    e(’user’,'domain.com’);

    function e(u,d) {
    document.write( ‘‘ + u + ‘@’ + d + ‘‘ );
    }

    Comment by Sander — May 24, 2008 @ 9:28 am

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word