Forum Moderators: phranque
1.) Display the email in an image
2.) Use javascript to prevent the scrapers from finding it.
3.) Use css to prevent the harvesters from finding it.
I am intrigued by option #2 and #3, but am not certain if these are effective. Anyone out there have any experience with this?
Tks.
Suzanne
<script type="text/javascript" language="JavaScript">
<!--
var user;
var domain = 'domain';
var suffix = 'com';function jmail(user)
{
document.write('<a href="' + 'mai' + 'lto:' + user + '@' + domain + '.' + suffix + '">' + user + ' @ ' + domain + '.' + suffix + '</a>');
}
// -->
</script>
And then you place this in as your link:
<span class="lightBlue">Last, First</span><br><script>jmail("username");</script></span>
The span isn't needed, I just used it to differentiate the text for the displayed names.
-ben
The mail-address (for display) is intermingled with invisible-CSS-tags to make it hard to parse. Actually the "@" stands between CSS tags. For a human reader, it's a perfect email address. For the bots its garbage.
If you cut and paste the mailadress, you get human-readable instructions which garbage parts to remove. This requires an IQ slightly above room temperature to follow the instructions.
Finally for those who like to click on the mailadress, a small Javascript comes into play where the actual email adress is encrypted with a secret key. Only the encrypted (garbage-looking) string is visible in the HTML source. The JS decrypts the address on the fly and launches the default email application with the correct address.
While setting this up, we also changed ALL email addresses. The result was pretty impressive - almost no SPAM at all to the new adresses.
What I haven't foreseen though is that some of my users are so dumb as to post their new, spam-free mailaddress into public forums etc...
<script language="javascript">
document.write("<a href=\"mailto:" + String.fromCharCode(114,101,116,117,114,110,
*115,64,115,97,115,113,117,97,116,99,104,99,111,109,105,99,115,46,99,111,109) + "\">" + String.fromCharCode(114,101,116,117,114,110,
*115,64,115,97,115,113,117,97,116,99,104,99,111,109,105,99,115,46,99,111,109) + "</a>");
</script>
That long string of numbers just represents the various char codes for the entire email string. To create this number list use the code below:
<script language="javascript">
email = new String("testl@test.com");
for (i=0;i<email.length;i++) {
document.write(email.charCodeAt(i) + ",");
}
</script>
Hope this helps.
*- line breaks added to prevent side scrolling
[edited by: tedster at 7:41 pm (utc) on Feb. 19, 2005]
How about uni-encoding?I can't find the link now, but I'd read that unicode encoding of e-mail addresses was too easy to break. I had to stop using that on my Chinese sites as all posted addresses were scraped within a few weeks of posting. The hiveware enkoder option has given the best results of late.