# Blosxom Plugin: gmaps_tag # Author: Dean Wilson # Version: 0.1 (20060404) # Plugin Homepage: http://www.unixdaemon.net/blosxom_plugins.html#gmaps_tag # License: GPL # Documentation: Please see the end of this file. package gmaps_tag; sub start { 1; } sub story { my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; $$body_ref =~ s!!return_link($1)!esg; $$body_ref =~ s!!return_link($1)!esg; $$body_ref =~ s!([^>]*)!return_link($1)!esg; 1; } sub return_link { my $location = shift; # sample named locations. my %locations = ( fot_office => 'EC1V 3QR', gllug => 'W1B 2UW', home => 'E15 4DQ', ); my $postcode = ($locations{$location} || $location ); my $url = qq!$location!; return $url; } 1; __END__ =head1 NAME Blosxom Plugin: gmaps_tag =head1 SYNOPSIS This extension allows you to link to locations (using Google Maps) in your blog posts without performing the tedious steps of looking up the location, getting the URL, putting it in an etc. You can specify a location using any of the following shortcuts: EC1V 3QR And it will be translated in to a full that points to the location on Google Maps. =head2 Named Locations This extension allows you to define "named locations". By naming a location and supplying a postcode (in the extension itself) you can use a friendly name rather than a raw postcode. =head1 VERSION 0.1 =head1 AUTHOR Dean Wilson =head1 LICENSE GPL =cut