如何spamproof一个mailto链接? [英] How to spamproof a mailto link?

查看:193
本文介绍了如何spamproof一个mailto链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望访问者能够直接在我的网页上点击(或复制)电子邮件地址。但是,如果我能够(一点点)让机器人和其他爬虫获得电子邮件地址并将其注册在垃圾邮件列表中,那将是非常棒的。

I want visitors to be able to click on (or copy) an email address directly on my webpage. However, if I could make it (a little bit) harder for bots and other crawlers to get said email address and register it in a spam list, it would be awesome.

我发现了不同的方法(即编码mailto HTML链接),使用JavaScript或纯HTML,但你们推荐什么? JavaScript技术似乎更复杂,但这可能会影响用户关闭的用户,以及像Google这样的合法抓取工具。

I found different ways of doing this (i.e. encoding mailto HTML links), either with JavaScript or in pure HTML, but what do you guys recommend ? The JavaScript techniques seem more complicated, but this may potentially affect users that have it turned off, and legit crawlers like Google.

另一方面,HTML似乎是有点基础,机器人作家现在应该已经弄清楚了...

On the other hand, the HTML one seems a bit basic, the bot writers should have figured it out by now...

我应该打扰一切,还是垃圾邮件发送者还会收到我的电子邮件吗?我知道反垃圾邮件过滤器越来越好,但是如果我可以做更多的事情来减慢垃圾邮件发送者的浪费,我将会。

Should I bother at all doing this, or will the spammers get my email anyway ? I know that antispam filters are getting better and better, but if I can do something more to slow spammers down, I will.

推荐答案

JavaScript remains one of the best mailto obfuscator. For users with JavaScript disabled you may want to substitute the mailto link with a link to a contact form.

以下是流行的反垃圾邮件电子邮件垃圾邮件:

The following is a popular JavaScript anti spam email obfuscator:

  • http://www.jottings.com/obfuscator/

还有一个一个php版本,以便能够从服务器端生成混淆的电子邮件。

There is also a php version of the above to be able to generate obfuscated emails from the server side.

这是上述工具产生的JavaScript代码,以模糊我的电子邮件地址(完整的评论):

This is the JavaScript code that the above tool would generate to obfuscate my email address (comments intact):

<script type="text/javascript" language="javascript">
<!--
// Email obfuscator script 2.1 by Tim Williams, University of Arizona
// Random encryption key feature by Andrew Moulden, Site Engineering Ltd
// This code is freeware provided these four comment lines remain intact
// A wizard to generate this code is at http://www.jottings.com/obfuscator/
{ coded = "lMnK@wMunFK8MDDMKKt.ktl"
  key = "1DtzZ8TGBuhRjJMKWI4gkUF2qidfOyPmSN7X30Vpso6xvErLnwQCbalA95HcYe"
  shift=coded.length
  link=""
  for (i=0; i<coded.length; i++) {
    if (key.indexOf(coded.charAt(i))==-1) {
      ltr = coded.charAt(i)
      link += (ltr)
    }
    else {     
      ltr = (key.indexOf(coded.charAt(i))-shift+key.length) % key.length
      link += (key.charAt(ltr))
    }
  }
  document.write("<a href='mailto:"+link+"'>Email Me</a>")
}
//-->
</script><noscript><a href='contact-form.html'>Email Me</a></noscript>

这篇关于如何spamproof一个mailto链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆