# Blosxom Plugin: Immediate Action Feeds
# Author: Dean Wilson (http://www.unixdaemon.net/about.html)
# Version: 0.1 (2006028)
# Plugin Homepage: # # http://www.unixdaemon.net/blosxom_plugins.html#ia_feeds
# License: GPL
# Documentation: Please see the end of this file.
# TODO: This has a lot of duplication in the code. Convert to a hash and
# iterate through the keys.
package ia_feeds;
use vars qw($blosxom::url $blosxom::path $blosxom::fn $blosxom::flavour);
use strict;
sub start {
1;
}
sub story {
my ($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
#################################################
# these are used for each link
#################################################
# change this to match your permalink format.
my $post_url
= "$blosxom::url$blosxom::path/$blosxom::fn.$blosxom::flavour";
my $title = $$title_ref;
#################################################
# Submit to reddit!
#################################################
my $re_link_desc = 'reddit this!';
my $re_base_url = q{http://reddit.com/submit?};
my $re_qs = "url=$post_url&title=$title";
#################################################
# Add to del.icio.us!
#################################################
my $del_link_desc = 'Add to del.icio.us!';
my $del_base_url = q{http://del.icio.us/post?};
my $del_qs = "url=$post_url&title=$title";
#################################################
# Digg Me!
#################################################
my $digg_link_desc = 'Digg Me!';
my $digg_base_url = q{http://www.digg.com/submit?};
my $digg_qs = "url=$post_url&title=$title&phase=3";
# add some space to avoid clutter.
$$body_ref .= qq{
Like this post? - };
$$body_ref .= qq{$digg_link_desc | };
$$body_ref .= qq{$del_link_desc | };
$$body_ref .= qq{$re_link_desc};
1;
}
1;
__END__
=head1 NAME
Blosxom Plugin: Immediate Action Feeds (ia_feeds)
=head1 SYNOPSIS
This extension adds a number of Immediate Action feeds to each Blosxom
post, both the HTML and RSS versions. 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
It currently puts "Digg Me!", "Submit to reddit!" and "Add to
del.icio.us!" links in at the bottom of the entry.
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