Filter or remove item.description from an RSS feed
-
22-08-2019 - |
Question
I would like to remove the item.description part of a twitter feed within yahoo pipes and I haven't figured out how to do it yet.
Obviously the filter module will remove posts with that item so I've been trying to use Regex. I think clearing the item.description field would work well enough. Is there a Regex expression that would replace the entire string?
Basically the goal is to make a twitter post that displays only the title and publish date. Basically, the item.description field is producing redundant information.
A copy of the pipe can be found here.
Solution
Ideally you would want to use an XSLT to do this - something like this:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="//description">
<description/>
</xsl:template>
</xsl:stylesheet>
But since you are using Pipes, try this regular expression:
<description>[^<]*</description>
with this:
<description/>
as a replacement string.
OTHER TIPS
To completely remove the description node, add this right before the output: