# Blosxom Plugin: add_to_delicious # Author: Dean Wilson (http://www.unixdaemon.net/about.html) # Version: 0.1 (20051224) # Plugin Homepage: # http://www.unixdaemon.net/blosxom_plugins.html#add_to_delicious # License: GPL # Documentation: Please see the end of this file. package add_to_delicious; use strict; sub start { 1; } sub story { my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_; # change this to match your permalink format. my $post_url = "$blosxom::url$blosxom::path/$blosxom::fn.$blosxom::flavour"; # you might use something more like this: # = "$blosxom::url/$blosxom::yr/$blosxom::mo_num/$blosxom::da#$blosxom::fn"; my $title = $$title_ref; my $link_desc = 'Tag this post with del.icio.us!'; my $del_base_url = q{http://del.icio.us/post?}; my $del_full_url = "url=$post_url&title=$title"; # heavy weight. Not a problem if you cache the run and server static site my $q = new CGI($del_full_url); my $del_post_esc = $q->query_string; $$body_ref .= qq{

}; $$body_ref .= qq{$link_desc}; 1; } 1; __END__ =head1 NAME Blosxom Plugin: add_to_delicious =head1 SYNOPSIS This extension adds a 'Tag this post with del.icio.us!' link to the bottom of every blog post and RSS item. It was inspired by an XML.com article on Immediate Action Feeds http://www.xml.com/lpt/a/2005/12/14/putting-rss-to-work-immediate-action-feeds.html Notes: If you plan to use this on your own blosxom powered site you'll probably need to change $post_url to suit your own permalink style. This plugin currently creates a CGI object way too often. If you build a static version of your site this won't be a problem. If your site is completely dynamic it's worth watching. =head1 VERSION 0.1 =head1 AUTHOR Dean Wilson (http://www.unixdaemon.net/about.html) =head1 LICENSE GPL =cut