[Zope] Re: Simple way to obfuscate email addresses to foil spambots?
Josef Meile
jmeile at hotmail.com
Sun Sep 14 12:11:31 EDT 2003
> Make a Python Script called antispam(stolen from HTMLgen.py):
>
> parameters: address
> ---------------------------------------------------
> import string
> from whrandom import choice
>
> buffer = map(None, address)
> for i in range(0, len(address), choice((2,3,4))):
> buffer[i] = '&#%d;' % ord(buffer[i])
>
> return string.join(buffer,'')
> ---------------------------------------------------
>
> on your pages, use mailtos like this:
>
> <a href=mailto:<dtml-var expr="antispam('myname at m...')"> >My
> Name</a>
Small, no javascript and clever. I'll steal it too :-)
Thanks for the trick,
Josef.
More information about the Zope
mailing list