# This file is an example of how to write a filter for DynamicTemplate. # It converts text into Javascript which when run reproduces the original # text. Its purpose is to hide email addresses from spam harvesters. # Copyright Bernard Simon, 2005. You may use this file as you wish as # long as this copyright notice is maintained. package Blosxom::Plugin::DynamicTemplate; use strict; sub encode { my @b = _xor_it (@_); my $c = "var a = [" . join (',', @b) . "];"; return <<"EOQ"; EOQ } sub _xor_it { my @a = map (ord ($_), split (//, join (' ', @_))); my @b; my $b = int (rand (256)); push (@b, $b); foreach my $a (@a) { $b = $b ^ $a; push (@b, $b); } return @b; } 1;