# Blosxom Plugin: amazon_buybox # Author: Victor Ganata # based on buy_from_amazon plug-in by Rael Dornfest # with modifications by Tony Williams # and also on examples from the Amazon.com WDK # Version: 0.1 # License: this plugin may be distributed with the same license as Blosxom package amazon_buybox; # Description: amazon_buybox is a Blosxom plugin that simplifies linking # into Amazon's catalog. # An element in a story like # description # turns into the following HTML snippet: #
description
#
# # picture of [description] # #
#
# # # # #
# Installation: # - Modify the $associateID (or don't :-) # - Drop amazon_buybox into your plugins directory # Configuration: $associateID = 'fatoprofugusn-20'; # opening and closing tags for element containing the buybox $container_open=qq{}; $container_close=qq{}; #opening and closing tags for element containing description $description_open=qq{
}; $description_close=qq{
}; # opening and closing tags for element containing image $image_open=qq{
}; $image_close=qq{
}; $button_text="Buy from Amazon.com"; sub start { 1; } # Modify the body of stories by rewriting elements sub story { my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; # Rewrite any tag in the post body $$body_ref =~ s{\(.*?)\} {$container_open $description_open$2$description_close $image_open \ \\"$2\" \ $image_close \
\ \ \ \ \ $container_close}xsg; 1; } 1;