App-WRT
view release on metacpan or search on metacpan
example/blog/public/feed view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>wrt::feed</title><subtitle>a test wrt site</subtitle><link href="https://example.com/"/><link href="https://example.com/feed" rel="self"/><icon>https://example.com/favicon.png</icon><author><name>Examp...
<article><div class="entry"><h1>Thursday, January 2, 2014</h1>
<p>Test.</p>
<p class="centerpiece"> ⨠</p>
<p>Test more.</p>
<p class="tags"><b>tags:</b> <a href="https://example.com/something">something</a></p><p class="datestamp"><a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/2/" title="2">2</a></p>
</div></article>
</content><updated>2020-07-23T16:45:33Z</updated></entry><entry><title>Wednesday, January 1, 2014</title><link href="https://example.com/2014/1/1"/><id>https://example.com/2014/1/1</id><content type="html">
<article><div class="entry"><h1>Wednesday, January 1, 2014</h1>
<p>Test.</p>
<p class="centerpiece">+</p>Test entry contents.
<p><em>more:</em> <a href="https://example.com/2014/1/1/test_entry" title="test_entry">test_entry</a></p>
<p class="datestamp"><a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/1/" title="1">1</a></p>
</div></article>
</content><updated>2020-07-23T16:45:33Z</updated></entry><entry><title>Wednesday, February 13, 1952</title><link href="https://example.com/1952/2/13"/><id>https://example.com/1952/2/13</id><content type="html">
<article><div class="entry"><h1>Wednesday, February 13, 1952</h1>
<p>I still miss you.</p>
<p class="datestamp"><a href="https://example.com/">wrt</a> /
<a href="https://example.com/1952/" title="1952">1952</a> /
<a href="https://example.com/1952/2/" title="2">2</a> /
<a href="https://example.com/1952/2/13/" title="13">13</a></p>
</div></article>
</content><updated>2020-07-23T16:45:33Z</updated></entry></feed>
example/blog/public/feed.xml view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>wrt::feed</title><subtitle>a test wrt site</subtitle><link href="https://example.com/"/><link href="https://example.com/feed" rel="self"/><icon>https://example.com/favicon.png</icon><author><name>Examp...
<article><div class="entry"><h1>Thursday, January 2, 2014</h1>
<p>Test.</p>
<p class="centerpiece"> ⨠</p>
<p>Test more.</p>
<p class="tags"><b>tags:</b> <a href="https://example.com/something">something</a></p><p class="datestamp"><a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/2/" title="2">2</a></p>
</div></article>
</content><updated>2020-07-23T16:45:33Z</updated></entry><entry><title>Wednesday, January 1, 2014</title><link href="https://example.com/2014/1/1"/><id>https://example.com/2014/1/1</id><content type="html">
<article><div class="entry"><h1>Wednesday, January 1, 2014</h1>
<p>Test.</p>
<p class="centerpiece">+</p>Test entry contents.
<p><em>more:</em> <a href="https://example.com/2014/1/1/test_entry" title="test_entry">test_entry</a></p>
<p class="datestamp"><a href="https://example.com/">wrt</a> /
<a href="https://example.com/2014/" title="2014">2014</a> /
<a href="https://example.com/2014/1/" title="1">1</a> /
<a href="https://example.com/2014/1/1/" title="1">1</a></p>
</div></article>
</content><updated>2020-07-23T16:45:33Z</updated></entry><entry><title>Wednesday, February 13, 1952</title><link href="https://example.com/1952/2/13"/><id>https://example.com/1952/2/13</id><content type="html">
<article><div class="entry"><h1>Wednesday, February 13, 1952</h1>
<p>I still miss you.</p>
<p class="datestamp"><a href="https://example.com/">wrt</a> /
<a href="https://example.com/1952/" title="1952">1952</a> /
<a href="https://example.com/1952/2/" title="2">2</a> /
<a href="https://example.com/1952/2/13/" title="13">13</a></p>
</div></article>
</content><updated>2020-07-23T16:45:33Z</updated></entry></feed>
lib/App/WRT.pm view on Meta::CPAN
my $feed = XML::Atom::SimpleFeed->new(
-encoding => 'UTF-8',
title => $self->{title_prefix} . "::" . $self->{feed_alias},
subtitle => $self->{description},
link => $self->{url_root},
link => { rel => 'self', href => $feed_url, },
icon => $self->{favicon_url},
author => $self->{author},
id => $self->{url_root},
generator => 'App::WRT.pm / XML::Atom::SimpleFeed',
updated => iso_date(get_mtime($first_entry_file)),
);
foreach my $entry (@entries) {
my $content = $self->{html_cache}{$entry};
if ( $self->{metadata_html_cache}{$entry} ) {
$content .= '<div class=entry-metadata>'
. $self->{metadata_html_cache}{$entry}
. '</div>';
}
my ($entry_file, $entry_url) = $self->root_locations($entry);
$feed->add_entry(
title => $self->get_title($entry),
link => $entry_url,
id => $entry_url,
content => $content,
updated => iso_date(get_mtime($entry_file)),
);
}
# Note: This output should be served with
# Content-type: application/atom+xml
#
# I'm not, to be frank, entirely clear on why the decode() call here is
# necessary:
return decode('UTF-8', $feed->as_string);
}
( run in 0.245 second using v1.01-cache-2.11-cpan-05444aca049 )