La tua posizione: 
essere testardo
Email harvesting
























EMAIL OBFUSCATOR AND ENCODER

Email harvesting is a real problem nowadays; publishing an email address on a web page means exposing it to automated email collection softwares. Once it's been collected there no way of getting rid of spam. The best way to avoid this is obfuscating and encoding email addresses; this simple javascript script does exactly that. It splits an address in six different parts, so that bots are not able to recognize it, and it also encode the @ symbol and the . (dot) using ascii codes, just to make it harder for bots to decode it. Even if the email harvesting software can read javascript and put the different parts of the address together, it would obtain an useless text like this: myaddress@mydomain.com instead of [email protected]

Source code:

<script language="JavaScript" type="text/javascript">
// Email obfuscator and encoder - version 1.2
// Example of usage with email address: [email protected]
// Visit https://www.nienteansia.it/altri-files/email_obfuscator_and_encoder/ for more informations and installation instructions
///////////////////////////////////////////////////////////////
// Beginning of email variables - modify to match your email address
var part1=('my-email-address'); // first part of address (before @) - change it to match your address
var part2=('my-domain-name'); // second part of address (after @) - change it to match your address
var part3=('com'); // last part of address without dot (com net org - etc.) -
change it to match your address
// End of email variables
///////////////////////////////////////////////////////////////
// Link text or image - link title - email subject - modify to your liking
var text=('Click here'); // link text - change it to your liking or use an image: <img src="image_path.gif">
var titl=('Send email to:'); // link title - change it to your liking
var subj=('Enter an email subject here'); // email subject - change it to what you prefer or leave it empty
///////////////////////////////////////////////////////////////
// Encoded variables - do not modify

var asciiend=(';'); // ascii code for ; - don't change it
var a1=('&#109;&#097;&#1')+('05'); // ascii code for mai - don't change it
var a2=('&#108;&#116;&#111;&#')+('58'); // ascii code for lto: - don't change it
var a4=('&#')+('46'); // ascii code for . (dot) - don't change it
var a5=('&#')+('64'); // ascii code for @ (at) - don't change it
var a6=('&#63;')+('&#115;&#117;&#098'); // ascii code for ?sub - don't change it
var a7=('&#106;&#101;&#099;&#116;')+('&#61'); // ascii code for ject= - don't change it
///////////////////////////////////////////////////////////////

// encode and put parts of address together
var em=(encodeURIComponent(('<')+('a ')+('hr')+('ef')+('=')+('"'))+(''+ a1 +'')+ (''+ asciiend +''));
var ai=(encodeURIComponent((''+ a2 +'')+(''+ asciiend +'')+(''+ part1 +'')+ (''+ a5 +'')));
var l=(''+ part2 +'');
var ad=(''+ a4 +'');
var dr=(''+ part3 +'');
var es=(encodeURIComponent(''+ a6 +'')+(''+ asciiend +''));
var s=(encodeURIComponent((''+ a7 +'')+(''+ asciiend +'')+(''+ subj +'')+('"')+ (' ')+('ti')+('tle')+('=')+('"')+(''+ titl +'')+(' ')+('' + part1 +'')+ (''+ a5 +'')+(''+ asciiend +'')+(''+ part2 +'')+(''+ a4 +'')+(''+ asciiend +'')+ (''+ part3 + '')+('">')+(''+ text +'')+('</')+('a>')));
var address=(escape((decodeURIComponent(''+ em +''))+(decodeURIComponent (''+ ai +''))+(''+ l +'')+(''+ ad +'')+(''+ dr +'')+(decodeURIComponent (''+ es +''))+(decodeURIComponent(''+ s +'')))); // decode and write address
document.write(unescape(''+ address +''));
</script>

Please don't copy and paste the code above. Follow the instructions below to use the script.


Example 1: Click here (script inserted inside the <body> section of the page)

Example 2: Click here (script loaded from an external .js file - keeps html code cleaner)

Example 3: Click here (using an image instead of a text link)



Installation (script inserted inside the <body> section):
1. Download the script package from the link situated at the bottom of this page.
2. Extract the files on your computer.
3. Open source_code.rtf and modify the following 4 variables to fit your email address and subject of the message: var part1 - var part2 - var part3 - var subj. Example: if the email address you want to protect is [email protected], your variables would look like these:
var part1=('address');
var part2=('domain');
var part3=('com');
var subj=('Contact from my site');

4. Modify var text to adjust the link text of your address. Example:
var text=('Click here to contact me');
You can use an image instead of text; just insert the image path as follows:
var text=('<img src="image_path.gif">');
5. You can optionally change the link title that will appear when moving the mouse pointer on the link (var bbb). Default one is:
var titl=('Send email to:');
6. Copy the modified code and paste it into the <body></body> section of the page where you want the email address to appear.
7. That's it. Enjoy!




Installation (script loaded from an external .js file):

1. Download the script package from the link situated at the bottom of this page.
2. Extract the files on your computer.
3. Open email_obfuscator.js and modify the following 4 variables to fit your email address and subject of the message: var part1 - var part2 - var part3 - var subj. Example: if the email address you want to protect is [email protected], your variables would look like these:
var part1=('address');
var part2=('domain');
var part3=('com');
var subj=('Contact from my site');

4. Modify var text to adjust the link text of your address. Example:
var text=('Click here to contact me');
You can use an image instead of text; just insert the image path as follows:
var text=('<img src="image_path.gif">');
5. You can optionally change the link title that will appear when moving the mouse pointer on the link (var bbb). Default one is:
var titl=('Send email to:');
6. Insert this code into the <head></head> section of the page in wich the email address will be displayed:

<script language="JavaScript" type="text/javascript" src="email_obfuscator.js"></script>

7. Remember to change src="email_obfuscator.js" with the correct path. You don't need to modify it if the external .js file and the page where you want the email address to appear are in the same directory.
8. Insert this code into the <body></body> section of the page where you want your email address to appear:

<script>document.write(unescape(''+ address +''));</script>

9. That's it. Enjoy!



Download source code and usage examples: click here

Psychology and psychotherapy
Scrivi un commento su Nienteansia.it
Switch to english language
Passa alla lingua italiana
Psychology newsletter

Unsub.
 
Nienteansia.it homepage
Informazioni ansia, psicoterapia
Nienteansia.it polls:
____________________
Do you want to publish an article?
____________________
Send it to our staff and we'll publish it in the Articles section of our site with your name and other informations.

Let's discuss it...
____________________
Visit our psychology forum and exchange your opinions with other people. Free registration.