Skip to main content

Email Link for Comments

Okay, I realized that my blog was missing something. A way to get in touch with me privately - by email. I realized this because I wanted to thank a person who made a nice comment on my site, but I had no easy way to say that privately, as she had no email link on her site. Then I realized, I don't have one on my site either!

And there is a good reason I didn't want to put my email on my website. Spam Spider Bots. I didn't want to get a lot of spam because my email address was on a web page.

I was thinking that I remembered seeing on a web site a javascript option to obscure an email. I did quick google, but all the javascript examples I saw were just creating the email as a standard link with the document.write() option. In other words, the result was a machine readable string, although a little harder for a spider to decode.

I decided I wanted a more complex method, that didn't actually make the email address until a user clicks on the link. That meant javascript with a function. I've tested it in IE (v6). I'm sorry if it doesn't work for other browsers.

My basic idea is to hide the email in a split up string:

// mailme @2004 Keith Horowitz - GNU Opensource Copyright/Copyleft
function mailme() {
t='MaAaIaLaTaOa:aTaEaSaTa'
t=t+'@aYaAaHaOaOa.aCaOaMa'
d=''
for (a = 0; a < t.length; a+=2 ) d=d+t.substr(a,1)
location.href=d
}

Look at the uppercase letters in the string above. Then the for loop strips out every other character into the new string d. Then the magical, location.href gets passed the valid mailto string. This causes the default email client to start a new email with the encoded email address.

The you need a link:

<a href=# onclick="mailme();return false">EMail Me</a>

Now this probably won't keep out all spam. But hopefully it should keep spiders from adding me to thier lists.

Comments

Popular posts from this blog

Hiking Blodgett Peak 12/25/2005

So Christmas day Sunday, but we don't do Christmas. And a day off Monday. No real plans until Sunday evening for Channukah. My toe finally feels well enough for a hike. Blodgett Peak has been calling to me for months - especially since I learned there was a geocache on top. So I get up a bit early - early for a day off from work - and head out for a hike. I don't know how far I'll get - but I want to at least get to the top of Blodgett Peak. I've got about 8 geocaches I can try for, depending on how I do. A couple are up in Pike National Forrest, past Blodgett Peak. It is slower going than I expected. I spend more time than I wanted looking for the first 4 geocaches - I only found 2 of them. The trail is Icy and muddy. It is not a great trail - it is not well prepared like the trail going up Pikes Peak. It is very easy to lose the trail - subtle paths seem to go off in many directions. In many places, the trail seems to go up very steep, loose gravel. Step...

1000 Greatest Movies

Found on Misanthropic-Tendencies From the NY Times - The Best 1,000 Movies Ever Made I've highlighted the ones I've seen from the list. As it is a big list, I've set it to be hidden. I've added some favorite quotes to ones I've seen. Show/Hide the list below A À Nous la Liberté (1932) About Schmidt (2002) Absence of Malice (1981) Adam’s Rib (1949) Adaptation (2002) The Adjuster (1991) The Adventures of Robin Hood (1938) Affliction (1998) The African Queen (1952) L’Age d’Or (1930, reviewed 1964) Aguirre, the Wrath of God (1972, reviewed 1977) A.I. (2001) Airplane! (1980) "I picked the wrong week to give up sniffing glue" Aladdin (1992) "Poof! Whaddya want?" Alexander Nevsky (1939) Alice Doesn’t Live Here Anymore (1975) Alice’s Restaurant (1969) Aliens (1986) '...In space no one can hear you scream.' All About Eve (1950) All About My Mother (1999) All Quiet on the Western Front (1930) All That...

I Voted, Colorado

Voting is different here in Colorado than it was back on the East Coast. In New Jersey, and I remember it was the same basic things when my parents voted in New York, the voting was in a mechanical voting booth. You would go to a desk and sign the big book. The would give you a sheet of paper. You would take the paper over to a voting machine. An assistant would take the paper and put it somewhere on the side of the machine. You would pull a big mechanical handle that would close the curtain behind you. Then you would flip the levers to indicate your vote. After, you would push the big handle, which would record your vote, reset the levers and open the curtain. Here in Colorado, the beginning of the process is the same. You wait on line and sign the big book. I went with my wife, as she dropped her car off for service. At first she was going to vote before she dropped off her car. But she called me to tell me the line was an hour long. After I picked her up at the shop,...