NAME
XML::FeedWriter::RSS20
SYNOPSIS
use XML::FeedWriter;
# let's create a writer.
my $writer = XML::FeedWriter->new(
# specify type/version; RSS 2.0 by default
version => '2.0',
# and channel info
title => 'feed title',
link => 'http://example.com',
description => 'blah blah blah',
);
# add as many items as you wish (and spec permits).
$writer->add_items(
# each item should be a hash reference
{
title => 'first post',
description => 'plain text of the first post',
link => 'http://example.com/first_post',
updated => time(), # will be converted to a pubDate
creator => 'me', # alias for "dc:creator"
},
{
title => 'second post',
description => '<p>html of the second post</p>',
link => 'http://example.com/second_post',
pubdate => DateTime->now, # will be formatted properly
creator => 'someone',
},
);
# this will close several tags such as root 'rss'.
$writer->close;
# then, if you want to save the feed to a file
$writer->save('path_to_file.xml');
# or just use it as an xml string.
my $string = $writer->as_string;
DESCRIPTION
This is an RSS 2.0 feed writer. You usually don't need to use this directly, but if you insist, replace XML::FeedWriter with XML::FeedWriter::RSS20 and it works fine.
METHODS
See XML::FeedWriter for usage.
new
add_items
close
save
as_string
SEE ALSO
http://www.rssboard.org/rss-profile
AUTHOR
Kenichi Ishigaki, <ishigaki@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2008 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.