This Instructable is for those with some web development knowledge who have their own websites.
The harvesters used are smart but not perfect. What they do is crawl through the web looking for text on pages that look like an email address: characters like "blahblahblah @ something . com". Whenever they detect a dot and an at symbol in the same text, they assume it to be an email address. So typing out your email address in plain HTML is not a very good idea because one of these bots will quickly store your email address in a database and often send out spam to you.
Step 1: Using a Program to Confuse a Program (the Part for Geeks)
Non-Geeks who just want a working copy for their website should move on to the next step to avoid the intricacies of how the code actually works.
Harvesters are just programs written in a way to capture your email address on a webpage. We can write a very simple program to confuse them.
We must create a string of characters that will represent the letters and symbols in our email address. We could also use one for email addresses that incorporate numbers and other symbols, but for simplicity of this tutorial I will only be showing you one for very basic email addresses that have only letters:
var chars="@abcdefghijklmnopqrstuvwxyz."; // for very simple email addresses that contain only letters
Next we create a variable that will hold our actual email address that we want to output to the webpage:
var email = "peter"+chars+"schlamp"+chars+"gmail"+chars+"com";
alert(email); // outputs my email address in an alert box
The next step will show all the code together and a way to output it on your page.
Step 2: Putting It All Together
You can place the following code on your site. All you have to do is change the email variable between the lines where it says to edit.
// chars = @
// chars = .
// chars = a ... chars = b ... chars = c ... chars = z ... get it?
// EDIT BELOW
// example: email@example.com
var email = "hel"+chars+chars+nums+nums+nums+chars+"gmail"+chars+"com";
// EDIT ABOVE
// place your email address in the email div
document.getElementById("email").innerHTML = email;