obfuscemail

2019-09-05 admin

obfuscemail是什么

什么是obfuscemail,An email obfuscator utilising the rot13 cipher. Cuts down on spam in mailto links.

obfuscemail使用教程帮助文档

Obfuscemail

Build Status Dependency Status

Adding contact email to your site is a great idea to allow people to contact you easily. However, it’s also a great way to put your email address on a dish for spammy web crawlers.

Obfuscemail is a simple command line utility and Node.js module to help with this issue. It generates javascript which creates nice links which appear and work as normal in a web browser, but are not readable by web crawlers. The actual email address is hidden by the rot13 cipher.

Installation

To install the command line utility globally:

sudo npm install -g obfuscemail

Or to install locally in an npm project:

npm install obfuscemail --save

Usage

To use in a HTML page, you must define where you want your mailto links to be injected by using the obfuscemail class (ANY element with this class will be turned into a mailto link).

Then to generate the javascript to include in this page you need to run:

obfuscemail -e "" -t "Anchor Tag Text"

You can also add an optional subject to the mailto link:

obfuscemail -e "" -t "Anchor Tag Text" -s "Subject for Email"

Obfuscemail can also be used as a Node.js module (see above for installation):

var obfuscemail = require('obfuscemail');

var js = obfuscemail.generate('test@example.com', 'Contact Me');

console.log(js);
/* This outputs an immediately-invoked function expression, which you
 * *could*, if you really wish, eval()...
 */

Example

  1. Add No email here! to a HTML page.
  2. Generate the javascript
回到顶部