|
Posted by Chris F.A. Johnson on 09/04/07 02:06
On 2007-09-03, andrew wrote:
> On 2007-09-03, JL <user@example.net> wrote:
>> Hi all
>>
>> The other day, I encountered a site with a mailto link like this:
>>
>><a
>> href="mailto:info@exam
> ;ple.com">
>> info@exampl
> e.com
>></a>
>>
>> Will this actually prevent anything from harvesting the email address?
>
> I have used this technique and it has proved very successful. Because
> I am a little lazy I used the following:
>
> http://www.addressmunger.com/
>
> to generate the mess :-)
I use this shell script:
## Convert e-mail address to obfuscated format for web pages
## Author: Chris F.A. Johnson, copyright 2007
w2()
{
w2h=$1
while [ -n "$w2h" ]
do
temp=${w2h#?}
printf "$2" "'${w2h%"$temp"}"
w2h=$temp
done
}
mailto="mailto:"
anchor='<a href="'
gt=">"
closetag="</a>"
url=$( w2 "${1// /}" "%%%x" )
daddr=$( w2 "$1" "&#%d;" )
link="$anchor$mailto$url\"$gt$daddr</a>"
printf "%s\n" "$link"
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
===================================================================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Navigation:
[Reply to this message]
|