App-Plog
view release on metacpan or search on metacpan
lib/App/Plog.pm view on Meta::CPAN
my ($self, $entries, $blog_directory, $temporary_directory) = @_ ;
my $page = $self->{page} ;
my $now_string = strftime '%Y-%m-%dT%H:%M:%SZ', localtime() ;
my $xml_atom_feed = XML::Atom::SimpleFeed->new
(
id => 0,
title => 'Plog Feed',
link => $page,
updated => $now_string ,
author => 'App::Plog',
) ;
while(my ($name, $entry) = each %{$entries})
{
my $entry_date_string = $entry->[0]{date} ;
$entry_date_string =~ s/^\s*(\d+-\d+-\d+)\s*/$1T/xsm ;
$entry_date_string =~ s/(\d+:\d+:\d+).*/$1Z/xsm ;
$xml_atom_feed->add_entry
(
title => $name, #
link => "$page#$entry->[-1]{commit}",
id => $entry->[-1]{commit},
updated => $entry_date_string ,
#~ summary => 'Summary',
) ;
}
write_file("$temporary_directory/rss.xml", $xml_atom_feed->as_string()) ;
return ;
}
#-------------------------------------------------------------------------------
( run in 0.381 second using v1.01-cache-2.11-cpan-05444aca049 )