RSS feed item content selection criteria issue

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
svangren
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 14 Feb 2017, 00:58

RSS feed item content selection criteria issue

Postby svangren » 14 Feb 2017, 01:17

Hello all,

I've set up a nice little tt-rss system on my Raspberry Pi, and on the whole, it's working beautifully. Also went and got the Android client, which is also quite nice. Good work!

However, I have come across a feed which causes a little issue: https://notalwaysright.com/feed

The issue boils down to line 86 in classes/feeditem/rss.php, it seems. When an item contains both a description and content, the code selects the longest string as article content. Alas, that's not always the way to go. As seen here, while the description is longer, it is also quite useless compared to the content:

Code: Select all

      <item>
         <title>Raw Stupidity</title>
         <link>https://notalwaysright.com/raw-stupidity/63536</link>
         <pubDate>Sun, 12 Feb 2017 18:00:01 +0000</pubDate>
         <dc:creator>
            <![CDATA[BD]]>
         </dc:creator>
         <category>
            <![CDATA[Crazy Requests]]>
         </category>
         <category>
            <![CDATA[Extra Stupid]]>
         </category>
         <category>
            <![CDATA[Food & Drink]]>
         </category>
         <category>
            <![CDATA[Fast Food]]>
         </category>

         <guid isPermaLink="false">https://notalwaysright.com/?p=63536</guid>
         <description>
            <![CDATA[<p>Fast Food | NY, USA</p>
<table cellpadding='10'>
<tr>
<td valign='top' align='left'>
<p>Categories: </p>
<ul class="post-categories">
<li><a href="https://notalwaysright.com/category/crazy-requests" rel="category tag">Crazy Requests</a></li>
<li><a href="https://notalwaysright.com/category/cant-be-that-stupid" rel="category tag">Extra Stupid</a></li>
<li><a href="https://notalwaysright.com/category/food-drink" rel="category tag">Food &amp; Drink</a></li>
</ul>
<p>Tags: <a href="https://notalwaysright.com/tag/fast-food" rel="tag">Fast Food</a></p>
<p>Me: "This isn't even raw."</p>
<p>Customer: "The lettuce is!"</p>
<table width='100%'>
<tr>
<td align=right>
<p><b>(<a href='https://notalwaysright.com/raw-stupidity/63536' title='Raw Stupidity'>Read more...</a>)</b></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>The post <a rel="nofollow" href="https://notalwaysright.com/raw-stupidity/63536">Raw Stupidity</a> appeared first on <a rel="nofollow" href="https://notalwaysright.com">Funny &amp; Stupid Customer Stories - Not Always Right</a>.</p>
]]>
         </description>
         <p>(<em>Fast Food</em> | <em>NY, USA</em>)</p>
         <content:encoded>
            <![CDATA[Fast Food | NY, USA<br /><br /><p><em>(I work as a janitor in a fast food restaurant.)</em></p>
<p><strong>Customer:</strong> &#8220;My burger is raw; take it back.&#8221;</p>
<p><strong>Me:</strong> <em>*cleaning up a spill*</em> &#8220;One second, I&#8217;ll go get the manager.&#8221;</p>
<p><strong>Customer:</strong> &#8220;No, You take it!&#8221;</p>
<p><strong>Me:</strong> &#8220;Um&#8230; okay.&#8221;</p>
<p><em>(I look at the burger.)</em></p>
<p><strong>Me:</strong> &#8220;This isn&#8217;t even raw.&#8221;</p>
<p><strong>Customer:</strong> &#8220;The lettuce is!&#8221;</p>
<p>The post <a rel="nofollow" href="https://notalwaysright.com/raw-stupidity/63536">Raw Stupidity</a> appeared first on <a rel="nofollow" href="https://notalwaysright.com">Funny &amp; Stupid Customer Stories - Not Always Right</a>.</p>
]]>
         </content:encoded>
      </item>


I can of course change it easily enough locally, but perhaps an option could be implemented on the feed level to force it to select either the content or description? The Atom articles are treated quite differently, so it's only an issue for some (rare) RSS feeds.

If not, it's not a particularly big deal, as I can probably slap together a plugin that'll just empty out the descriptions for this feed (or others with similar issues). After all - that's the benefit of having an open, extensible aggregator... :-)

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: RSS feed item content selection criteria issue

Postby fox » 14 Feb 2017, 08:03

yes, you should make a plugin.

svangren
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 14 Feb 2017, 00:58

Re: RSS feed item content selection criteria issue

Postby svangren » 14 Feb 2017, 23:16

And so it shall be. In case anyone else needs it, I'll post the fruits of my labor over in the appropriate subforum.

Thanks!

For the curious:
https://tt-rss.org/forum/viewtopic.php?f=22&t=4055


Return to “Support”

Who is online

Users browsing this forum: No registered users and 11 guests