NAME

Syndication::ESF - Create and update ESF files

SYNOPSIS

        use Syndication::ESF;

        my $esf = Syndication::ESF->new;

        $esf->parsefile( 'my.esf' );

        $esf->channel( title => 'My channel' );

        $esf->add_item(
                date  => time
                title => 'new item'
                link  => 'http://example.org/#foo'
        );

        print "Channel: ", $esf->channel( 'title' ), "\n";
        print "Items  : ", scalar @{ $esf->{ items } }, "\n";

        my $output = $esf->as_string;

        $esf->save( 'my.esf' );

DESCRIPTION

This module is the basic framework for creating and maintaing Epistula Syndication Format (ESF) files. More information on the format can be found at the Aquarionics web site: http://www.aquarionics.com/article/name/esf

This module tries to copy the XML::RSS module's interface. All applicable methods have been copied and should respond in the same manner.

Like in XML::RSS, channel data is accessed through the channel() sub, and item data is accessed straight out of the items array.

METHODS

new()

Creates a new Syndication::ESF object. It currently does not accept any parameters.

Supplying no parameters will give you a reference to the channel data. Specifying a field name returns the value of the field. Giving it a hash will update the channel data with the supplied values.

By default, this will append the new item to the end of the list. Specifying 'insert' for the mode parameter adds it to the front of the list.

parse($string)

Parse the supplied raw ESF data.

parsefile($filename)

Same as parse(), but takes a filename as input.

as_string()

Returns the current data stored in the object as a string.

save($filename)

Saves the value of as_string() to the supplied filename.

BUGS

If you have any questions, comments, bug reports or feature suggestions, email them to Brian Cassidy <brian@alternation.net>.

CREDITS

This module was written by Brian Cassidy (http://www.alternation.net/).

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, distributed with Perl.

SEE ALSO

XML::RSS