How to hide email address on website from robots?

Status
Not open for further replies.

suhasingale

Journeyman
On the website *www.python.org/Jobs.html i found some email address links, now the funda over here is in IE6 when we move our mouse over this email address links see something like "%6A%68%6F%64%67%65%40%65%78%61%2E%63%6F%6D" instead of the email address and if we click on that the email id comes out also if we view the properties we are able to see the mail id. I have also downloaded the jobs.html from their FTP site and the coding over ther was
[*]Other Contact Info: J. Hodge, HR Manager, jhodge at exa dot com.

Someone please tel me how do i convert my email id's to such type of coding so that i can implement it on my website.
 

alib_i

Cyborg Agent
Those are ASCII codes written in hexadecimal form.
It's a popular method to hide email addresses.

Read this page: Hexadecimal explained (scroll down to "Web Address" part)
To convert your email-addr to ASCII: Conversion Chart

Interestingly Firefox shows the email address normally .. even on mouse hover.
Moreover if you want to hide your email address .. then the best method is to create an image with your addr written .. that'll surely defeat all kinds of bots :)

-----
alibi
 

siriusb

Cyborg Agent
Hmm, I was actually writing a function in javascript to replace all mailto: addresses when I saw this. It's simple and uses escape() function to do the job.
 
OP
S

suhasingale

Journeyman
alib_i said:
Interestingly Firefox shows the email address normally .. even on mouse hover.
-----
alibi

I also observered this but forgot to mention it in my post. But anyways u were of gr8 help for me. Thanks buddy.
 
OP
S

suhasingale

Journeyman
siriusb said:
Hmm, I was actually writing a function in javascript to replace all mailto: addresses when I saw this. It's simple and uses escape() function to do the job.

I wud be very much thankful to u if u share ur script with us (if u don't mind).
 

siriusb

Cyborg Agent
Sure I will, if I finish writing it. The escape () function only urlencodes the string. Converting html to Hex is what is required. Let me learn that first.

[edit] I think this ought to be done at the server side, coz I can't make the source code to change. Only the behaviour changes. Currently, this code works only with IE. I don't know why. I am new to javascript.
Code:
<script language="javascript">
function unes ()
{
	var ace=document.getElementsByTagName ('a');
	for (x=0; x<ace.length; x++) 
	{
		if (ace[x].href.toLowerCase ().indexOf ('mailto:') == 0)
			myUrlEncode (ace[x].href.substr (7), ace[x]);
	}

/* From *computercops.biz/viewlink-80.html */
	function myUrlEncode(str, urlLink)
	{
		var result = "";
		var i = 0;

		for (i=0; i < str.length; i++)
		{
			result = result + "%";
			result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/16)&0x0F);
			result = result + "0123456789ABCDEF".charAt((str.charCodeAt(i)/1)&0x0F);
		}
	
		urlLink.href = "mailto:" + result; /*Set the test hyperlink with this value*/
	}
}
</script>
 

alib_i

Cyborg Agent
To convert string to ASCII in PHP ...

Code:
$encoded = strrev(chunk_split(strrev(bin2hex($string)), 2, '%'))

if $string="me@my.com"
then $encoded="%6d%65%40%6d%79%2e%63%6f%6d"
you can take care of rest of it.

PS: I just saw siriusb has posted a javascript code for the same :)

-----
alibi
 
Status
Not open for further replies.
Top Bottom