Skip to content

Commit

Permalink
Fixes to call to convert format
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Charles authored and davorg committed Dec 13, 2009
1 parent b9db239 commit b1fea17
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/Perlanet.pm
Expand Up @@ -293,7 +293,7 @@ sub fetch_feeds
or next;

if ($xml_feed->format ne $self->cfg->{feed}{format}) {
$xml_feed = $xml_feed->convert($feed->format);
$xml_feed = $xml_feed->convert($self->cfg->{feed}{format});
}

$feed->_xml_feed($xml_feed);
Expand Down Expand Up @@ -330,6 +330,12 @@ sub select_entries
push @feed_entries,
map {
$_->title($feed->title . ': ' . $_->title);

# Problem with XML::Feed's conversion of RSS to Atom
if ($_->issued && ! $_->modified) {
$_->modified($_->issued);
}

Perlanet::Entry->new(
_entry => $_,
feed => $feed
Expand Down Expand Up @@ -386,6 +392,7 @@ sub build_feed
);

$f->add_entry($_->_entry) for @entries;

return $f;
}

Expand All @@ -394,8 +401,8 @@ sub render
my ($self, $feed) = @_;
my $tt = Template->new;

for my $entry ($feed->entries) {
$entry->content->body($self->clean($entry->content->body));
for my $entry (@{ $feed->entries }) {
$self->clean($entry->content->body);
}

$tt->process(
Expand Down

0 comments on commit b1fea17

Please sign in to comment.