Forum Moderators: open

Message Too Old, No Replies

Nice js solution for email harvesters

         

littleman

1:26 am on Jan 30, 2002 (gmt 0)



[innerpeace.org...]
It scrambles up your email address and then has the browser's js slap it back together.

chiyo

3:52 am on Jan 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



nice solution.. he doesn't mention that a minority of users surf without js though, even though he is correct in saying that most browsers DO support js. Not sure where he gets 99% specifically from though.

The other problem is that it is a fair bit of code for one email address.

Then again, its free and a nice contribution.

Anybody know of any other suggestions? I remember reading of other js solutions through the years.

We have been milling around a very simple solution. Just dont link the email addresses. People who really want to email you can. It really is little to ask serious enquiriers to type your email or copy and paste than just click. That way you may also reduce silly email messages too.

Then also remember that many email scum-companies just get a list or domains and add common prefixes like webmaster, info, sales, etc. and even heard that some just scramble all possible permutations of three letter prefixes meaning if you have a 3 letter or common prefix to the email address, these solutions are still no help!

Interested to hear what others are doing here. A form-mailer is another way I guess.

littleman

5:24 am on Jan 30, 2002 (gmt 0)



Just today I emailed a person who had is address written like 'name_at_domain_dot_com', he had it linked like that and everything. That will work, but it will confuse many of the aol types.

chiyo

6:35 am on Jan 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



very creative..

Marshall

7:27 am on Jan 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I find using an external JavaScript feed works really well. It's also good if your address is on several pages since you can change it at will. Something akin to:
document.write ("<a href='mailto:whatever@where-ever.com'>Email Us<\/a>")

Then in the page I merely put <script type="text/javascript" src="URLofScript.js"> </script>

I also include a <noscript> link to a text page, which opens in a new window, with contact information. I figure an Email harvesting robot is less likey to spider a .txt page. On the page I include an explanation of why it's being done that way.

bird

3:29 pm on Jan 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is what I use (replacing initial tabs with "...." for the broken [.code] markup, remove spaces from SGML unicode entities):

--------- addrencode.py ------------------

 
#!/usr/local/bin/python

import sys
import string

def quote(c):
....n = ord(c)
....if 32 < n < 123: return '& #%d;' % n
....return c

def encode():
....m = '& #109;& #97;& #105;& #108;& #116;& #111;& #58;'
....sys.stdout.write('Content-Type: text/html\n\n')
....if len(sys.argv) < 2: return
....parts = string.split(sys.argv[1], ' ')
....e = string.join(map(lambda c:quote(c), parts[0]), '')
....s = string.join(parts[1:] + [string.join(sys.argv[2:], '+')])
....sys.stdout.write('<a href=%s%s>%s</a>' % (m, e, s or e))

encode()


---------------------------------------------

Include this into your HTML per SSI like this:

<!--#include virtual="/cgi-bin/addrencode.py?info@example.com Mail me!"-->
<!--#include virtual="/cgi-bin/addrencode.py?info@example.com"-->

Both forms will encode the info@example.com address with SGML unicode entities, any non-ASCII characters in the address will be passed through unchanged.
The first form will display the link as [u]Mail Me![/u], the second one will display it with the e-mail address as the link text, again properly encoded.

The address may not contain any spaces or "+" signs. I'm not aware of any other limitations.

Feel free to make a mess of it by converting to Perl or PHP... ;)