Stuff that,
I'm sick of looking at bob at smith dot com.
Why can't we just write emails in a way that looks normal to people,
but is very,
very difficult to scrape off.
Most email scrapers only use very very simple parsing methods.
And it isn't as if it is hard to just do.

This module was written during OSDC/YAPC.AU to demonstrate how quick and easy it is to write a basic module and put it on CPAN. The code was written in about 40 minutes, the documentation was added during a break period before drinks and dinner, and the packing and test files were added during the python keynote (significant whitespace... ew...).

This module starts by applying a fairly basic set of character escapes to avoid the most basic scrapers, and then layers more and more crap on randomly, so that any scraper will need to implement more and more of a full web browser, while keeping the email looking "normal" to anyone browsing.

I've only scraped the surface of what we can achieve, and I'll leave it to others to submit patches to improve it from here on.

The new constructor creates a new obfuscation object, which use can then use to obfuscate as many email addresses as you like, at whatever severity you want it to be done.

It takes two optional parameters.

If you set the 'javascript' param, the obfuscator will add JavaScript obfuscation (possibly, and randomly) to the mix of obfuscation routines.

If you set the 'lite' param, the obfuscator will only use the most basic form of escaping, which will only fool scanner that don't do HTML entity decoding. Setting 'lite' implies that JavaScript should not be used, even if you explicitly try to turn it on.

OK, other than compile testing, I admit that I haven't really done anything significant in the way of testing. I mean, there was SUCH an interesting python talk on, and how on earth do you test something that has randomised output. :/