# Format Plug-in for
# Blagg: the Blosxom RSS aggregator
# Author: DJ Adams <dj.adams@pobox.com>
# Version: 0+1

# A very simple formatting Blagg plug-in to place the title 

# Usage:
# Add the following to the standard -blog and -mode command-line switches:
# -plugin=f-title - activate the title format plug-in
#
# NOTE - The whole point of this module is to replace the .txt file
#        that blagg will create. It requires a small mod to blagg - 
#        so that the filename ($i_fn in blagg) is passed at the end
#        of the parameter list in the call to blaggplug::post()
#
# E.g. 
# blagg -blog=someblog -mode=interactive -plugin=f-title

package blaggplug;

use strict;

use CGI qw{:standard}; # access to command-line switches (e.g. -blog=someblog)
use FileHandle;

my $fh = new FileHandle;

sub init {
}

sub post {
	my($i_title, $i_link, $i_desc, $f_title, $f_link, $i_fn) = @_;
	my $item = "$i_title ($f_title)\n$i_desc<br />\n(" . a({-href=>$i_link},'link') . ") [" . a({-href=>$f_link}, $f_title) . "]\n";
	$fh->open("> $i_fn") && print($fh $item) && $fh->close();
}

sub destroy {
}

1;
