App-Chronicle
view release on metacpan or search on metacpan
lib/Chronicle/Plugin/Generate/RSS.pm view on Meta::CPAN
#
# Add the entries.
#
$c->param( top => $config->{ 'top' } );
$c->param( entries => $entries ) if ($entries);
#
# Output the rendered template.
#
my $rss_output = "$config->{'output'}/index.rss";
open my $handle, ">:encoding(UTF-8)", $rss_output or
die "Failed to open `$rss_output': $!";
print $handle $c->output();
close $handle;
#
# Show the number of entries written if we're being verbose.
#
if ( $config->{ 'verbose' } && $entries )
{
print "Wrote " . scalar(@$entries) . " items to $rss_output\n";
}
}
1;
=head1 LICENSE
This module is free software; you can redistribute it and/or modify it
under the terms of either:
a) the GNU General Public License as published by the Free Software
Foundation; either version 2, or (at your option) any later version,
or
b) the Perl "Artistic License".
=cut
=head1 AUTHOR
Steve Kemp <steve@steve.org.uk>
=cut
__DATA__
<?xml version="1.0"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns="http://purl.org/rss/1.0/"
>
<channel rdf:about="<!-- tmpl_var name='top' -->">
<title><!-- tmpl_var name='blog_title' escape='html' --></title>
<link><!-- tmpl_var name='top' --></link>
<description><!-- tmpl_var name='blog_subtitle' escape='html' --></description>
<items>
<rdf:Seq>
<!-- tmpl_loop name="entries" -->
<rdf:li rdf:resource="<!-- tmpl_var name='top' --><!-- tmpl_var name='link' -->"/>
<!-- /tmpl_loop name="entries" -->
</rdf:Seq>
</items>
</channel>
<!-- tmpl_loop name="entries" -->
<item rdf:about="<!-- tmpl_var name='top' --><!-- tmpl_var name='link' -->">
<title><!-- tmpl_var name='title' escape='html' --></title>
<link><!-- tmpl_var name='top' --><!-- tmpl_var name='link' --></link>
<content:encoded><!-- tmpl_var name="body" escape='html' --></content:encoded>
<dc:date><!-- tmpl_var name='iso_8601' --></dc:date>
</item>
<!-- /tmpl_loop name='entries' -->
</rdf:RDF>
( run in 2.102 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )