summaryrefslogtreecommitdiff
path: root/filter.xsl
blob: a76d8f873ae14fe4459d49d69ce38df0fee723ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?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, 'Spotify') or contains($summary, 'Spotify')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'Erpressungstrojaner')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'Erpressungs-Trojaner')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'Opera')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'Smartphone-Trojaner')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'iPhone') or contains($summary, 'iPhone')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'iOS-Spyware')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'WhatsApp')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'Kim Dotcom')">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, 'Zuckerberg')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'Uber')">SKIP</xsl:if>
        <xsl:if test="contains($title, 'Microsoft')">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>