# Blosxom Plugin: similarity # Author(s): Kyo Nagashima # Version: 1.1a # Blosxom Home/Docs/Licensing: http://www.blosxom.com/ package similarity; use strict; use vars qw($code); # --- Configurable variables ----------- my $charcode = 'utf-8'; # --- Plug-in package variables -------- # -------------------------------------- sub start { return 0 unless $blosxom::path_info =~ /\./; return 1; } sub story { my($pkg, $path, $fn, $story_ref, $title_ref, $body_ref) = @_; my $url = escape("$blosxom::url$path/$fn.$blosxom::default_flavour"); $code = <<"_SIMILARITY_";
_SIMILARITY_ chomp $code; return 1; } sub escape { my $str = shift; $str =~ s/([^\w ])/sprintf("%%%02X", ord($1))/eg; $str =~ tr/ /+/; return $str; } 1;