Hacker News new | ask | show | jobs
by redmage 5979 days ago
I use a combination of reCAPTCHA Mailhide [1] and Javascript.

By default I use the link to my "mailhidden" email. Then, some Javascript code [2] replaces that link with a mailto link. The email is saved in the js file after being ROT13'd and encoded as HTML ASCII entities.

If the user has JS active, he/she sees a regular mailto link. Otherwise, he/she sees an http link to recaptcha and, as long as the user's browser can display images, he/she can solve the captcha and see my email address.

You can see an example of this working in my personal site. [3]

Until spambots can run javascript or solve recaptchas, I'm safe. :)

[1] http://mailhide.recaptcha.net/

[2] http://ricardomartins.cc/js/email.js

[3] http://ricardomartins.cc

1 comments

Is capthca even necessary?
Well, it's not strictly necessary, I could have just used an image with my email address but that could be harvested by OCR-capable spambots (I think there are a few in the wild) and wouldn't be clickable. ;)

With the captcha, I can be fairly sure that a human solved it (reCAPTCHA is particularly good at filtering bots, afaik) and the user gets a clickable link.

In any case, that's just to accomodate browsers without Javascript or with it disabled. I believe most people have Javascript enabled, so they'd get a regular mailto link.