« Evaluations for BP301 at Lotusphere 2006 | Main| Dance Shoes for Charity? »

Email Obfuscation

QuickImage Category Technical

Email harvesting "spiders" normally use a form of pattern matching algorithm to suck email addresses off of web pages. One of the ways that folks attempt to avoid this is by obfuscating their email addresses. I'm sure you've all seen something like this before, people will post their email address in a manner similar to this: devin dot olson AT this lighthouse dot com (replace the word this and the space with "az").

While this does work in that it foils the harvesters, it has always seemed a little bit silly and unprofessional to me. So, I did a little thinking and came up with a solution that is pretty simple to implement, yet has the air of elegance. It is elegant in that it is ridiculously simple to do.

Spiders & harvesters rarely stay on a page more than a second or so, and don't like to consume or run Javascript. So, the solution I came up with was to simply obfuscate the email address on the source html page in such a manner that the spider wouldn't recognize it, and then use Javascript to turn it into something readable, printable, and usable (such as with a mailto: href) to the user. As long as the Javascript delays activating until after the spider has left the page, then, I figured, this should be no problem.

Most spiders / harvesters stay on a page for at most about one and a half seconds before moving on. The reason for this is that all they are doing is searching for hrefs and email addresses; anything else is ignored. As long as my Javascript does it's "magic" after the spider would reasonably be expected to have abandoned the page, then this should work just fine. I decided to double this 1 1/2 second, and then add some more. My code fires 3.2 seconds after the page has loaded. I'm using nothing more than a set timeout() function.

All the Javascript does is search for specifically formatted & named div elements on the page. When it finds these elements, it runs some search & replace logic against their inner html, and resets the display style property. Oh yeah, I added support for dynamically assigning a CSS class to the div element as well.

I have posted the code (both complete js library and compressed version), along with a couple of sample html files, to my downloads page. The complete source file (azlwEMU-SOURCE.js) is fully commented, and should explain my logic and how the Javascript works. Because it is fully commented, it is a bit large. If you decide you want to use this as a solution for your site, I recommend you use the compressed library (azlwEMU.js) instead. This one has all of the whitespace and comments removed (except for my Intellectual Property Advisory Notice, of course), so it should load quite a bit faster (being only about 1/3 the size of the full version).

There are two other files included in the download (SamplePage.html & azlwEmailObfuscator.html); see the description on the downloads page for details.

Oh yeah, I almost forgot. This solution is not just for Domino;

It will work with any html page or form.

As with everything I post to my downloads page, the code is free for you to use in any way you see fit. Just be a cool frood and give credit where credit is due, ok? Thanks. Hope you like it.

-Devin

Comments

Gravatar Image1 -

I read an older (November 10, 2004) post (and commented on it) the other day over at Brad Hopkins' site. He discusses various methods of email obfuscation, and points out several email obfuscator sites as well.

Yes, I think my solution is better , but his post is still worth reading; and several of the email obfuscator sites he points out do a good job.

You can read his post at:
https://www.gbradhopkins.com/archives/2004/11/obfuscate_your.html

-Devin

Search

Wowsers! A Tag Cloud!

Links

MiscLinks