diff options
author | Yves Fischer <yvesf-git@xapek.org> | 2016-08-27 17:52:13 +0200 |
---|---|---|
committer | Yves Fischer <yvesf-git@xapek.org> | 2016-08-27 17:57:29 +0200 |
commit | 8ce41c4331d3e9386119516bf482a07456c4a5ec (patch) | |
tree | dc49882ce5d464aa9f07bd230c2474561a208aa4 /filter.xsl | |
download | heise-eisschrank-8ce41c4331d3e9386119516bf482a07456c4a5ec.tar.gz heise-eisschrank-8ce41c4331d3e9386119516bf482a07456c4a5ec.zip |
heise-eisschrank
Diffstat (limited to 'filter.xsl')
-rw-r--r-- | filter.xsl | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/filter.xsl b/filter.xsl new file mode 100644 index 0000000..0ebbe4b --- /dev/null +++ b/filter.xsl @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:atom="http://www.w3.org/2005/Atom" +> + <xsl:template match="@*|node()"> + <xsl:copy> + <xsl:apply-templates select="@*|node()"/> + </xsl:copy> + </xsl:template> + + <xsl:template match="title"> + <atom:title>heise online News (filtered)</atom:title> + </xsl:template> + + <xsl:template name="test"> + <xsl:param name="title"/> + <xsl:param name="summary"/> + <xsl:if test="contains($title, 'Apple') or contains($summary, 'Apple')"> + SKIP + </xsl:if> + <xsl:if test="contains($title, 'iPhone') or contains($summary, 'iPhone')"> + SKIP + </xsl:if> + <xsl:if test="contains($title, 'WhatsApp')"> + SKIP + </xsl:if> + <xsl:if test="contains($title, 'Dropbox') or contains($summary, 'Dropbox')"> + SKIP + </xsl:if> + <xsl:if test="contains($title, 'Facebook')"> + SKIP + </xsl:if> + <xsl:if test="contains($title, 'Uber')"> + SKIP + </xsl:if> + <xsl:if test="contains($title, 'Windows 10')"> + SKIP + </xsl:if> + </xsl:template> + + <xsl:template match="atom:entry"> + <xsl:variable name="testResult"> + <xsl:call-template name="test"> + <xsl:with-param name="title" select="atom:title/text()"/> + <xsl:with-param name="summary" select="atom:summary/text()"/> + </xsl:call-template> + </xsl:variable> + <xsl:choose> + <xsl:when test="contains($testResult, 'SKIP')"> + <xsl:comment> + Skip entry: + <xsl:copy-of select="."/> + </xsl:comment> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="."/> + </xsl:otherwise> + </xsl:choose> + </xsl:template> +</xsl:stylesheet>
\ No newline at end of file |