Wednesday, 5 March 2008

email harvesting prevention - simple and efficient

On this page I've seen this nice way of preventing email addresses harvesting (I have noscripts installed):

When javascript is enabled/permited, it looks like this:

The code is really simple and could be easily automatically applied to pages (the code obfuscates even more, but that is irrelevant - see the original source for the code):
<script language='JavaScript' type='text/javascript'>
var prefix = 'ma' + 'il' + 'to';
var path = 'hr' + 'ef' + '=';
var addy35780 = 'g.martinez' + '@';
addy35780 = addy35780 + 'pcbsd' + '.' + 'es';
document.write( '<a ' + path + '\'' + prefix + ':' + addy35780 + '\'>' );
document.write( addy35780 );
document.write( '<\/a>' );
//-->\n </script><script language='JavaScript' type='text/javascript'>
document.write( '<span style=\'display: none;\'>' );
</script>This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
<script language='JavaScript' type='text/javascript'>
document.write( '</' );
document.write( 'span>' );

BTW, the PC-BSD site looks really nice, unlike Debian's.


Anonymous said...

Unlike, the PC-BSD website doesn't fit into a normal screen window in my browser, so I don't think it looks good at all. Not everyone has massive monitors or extreme resolution. Some of us are quite happy on low res and find horizontal scrolling to be a sign of an incredibly poor (even elitist) design. All I can see is the first 55% of the screen - anything beyond the edge of the (IMHO unwarranted) random-bloke graphic is off the screen. Looks like poor use of CSS.
(PS I still can't view the comment form in English - "Parolă" makes no sense to me, sorry. 'Anonim' I can guess. ;-))

Anonymous said...

This works until Spam-Bots use Gecko or WebKit to harvest the web.

Jon Dowland said...

RE: anon: agreed, I think the javascript munging is a waste of time.

Re: PS-BSD vs. Debian: the width is too wide for me, too, and I use 1280x1024 at work. It's "prettier". More importantly, it seems to actually carry content I'm likely to want to read (I never read