Try some escaping stuff with the feed

This commit is contained in:
swag 2023-05-03 14:07:27 -04:00
parent 2838f73840
commit 414872730c
3 changed files with 157 additions and 2 deletions

BIN
.feed.xml.swp Normal file

Binary file not shown.

149
feed.xml Normal file
View File

@ -0,0 +1,149 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>
<channel>
<title>Post::Text</title>
<link>http://localhost:3000/thread/list</link>
<description>In UTF-8 we trust. &#x1FAE1;</description>
<lastBuildDate>Wed, 03 May 2023 14:05:24 EDT</lastBuildDate>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/305</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">305</guid>
<pubDate>Wed, 3 May 2023 14:05:16 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/304</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">304</guid>
<pubDate>Wed, 3 May 2023 14:04:36 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/303</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">303</guid>
<pubDate>Wed, 3 May 2023 14:00:14 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/302</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">302</guid>
<pubDate>Wed, 3 May 2023 13:55:16 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/301</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">301</guid>
<pubDate>Fri, 28 Apr 2023 13:04:38 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/300</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">300</guid>
<pubDate>Fri, 28 Apr 2023 12:50:03 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/299</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">299</guid>
<pubDate>Fri, 28 Apr 2023 12:44:21 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/298</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">298</guid>
<pubDate>Wed, 26 Apr 2023 11:03:27 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/297</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">297</guid>
<pubDate>Tue, 25 Apr 2023 23:09:02 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/296</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">296</guid>
<pubDate>Tue, 25 Apr 2023 22:42:10 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/295</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">295</guid>
<pubDate>Tue, 25 Apr 2023 22:09:19 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/294</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">294</guid>
<pubDate>Tue, 25 Apr 2023 22:07:55 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/293</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">293</guid>
<pubDate>Tue, 25 Apr 2023 18:44:21 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/292</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">292</guid>
<pubDate>Tue, 25 Apr 2023 18:43:16 EDT</pubDate>
</item>
<item>
<title>hi</title>
<link>http://localhost:3000/thread/single/291</link>
<description>&#x3C;p&#x3E;ayy... lmao&#x3C;/p&#x3E;
</description>
<author>Anonymous</author>
<guid isPermaLink="false">291</guid>
<pubDate>Tue, 25 Apr 2023 18:42:26 EDT</pubDate>
</item>
</channel>
</rss>

View File

@ -3,6 +3,7 @@ package PostText::Controller::Thread;
use Mojo::Base 'Mojolicious::Controller', -signatures;
use Date::Format;
use XML::RSS;
use XML::Entities;
sub create($self) {
my $v;
@ -105,6 +106,11 @@ sub feed($self) {
);
for my $thread (@{$threads}) {
my $description =
XML::Entities::decode(
'all',
$self->markdown($self->truncate_text($thread->{'body'}))
);
my $item_link =
$self->url_for(
single_thread => {thread_id => $thread->{'id'}}
@ -113,7 +119,7 @@ sub feed($self) {
$rss->add_item(
title => $thread->{'title'},
link => $item_link,
description => $self->truncate_text($thread->{'body'}),
description => $description,
author => $thread->{'author'},
guid => $thread->{'id'},
pubDate => $thread->{'date'}