summaryrefslogtreecommitdiff
path: root/.config/pancake/unclutter/hacker-news.xsl
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-13 17:32:02 +0300
committerdefanor <defanor@uberspace.net>2017-12-13 17:32:02 +0300
commitcd173146e98e9acb5c5cb4eea861019cc796932e (patch)
treebcf5293eec0a4cbda9c98af1438d64855b5c7645 /.config/pancake/unclutter/hacker-news.xsl
parent90c144467eb67e1a020f51443613a3af133cff52 (diff)
Add pancake configuration
Diffstat (limited to '.config/pancake/unclutter/hacker-news.xsl')
-rw-r--r--.config/pancake/unclutter/hacker-news.xsl33
1 files changed, 33 insertions, 0 deletions
diff --git a/.config/pancake/unclutter/hacker-news.xsl b/.config/pancake/unclutter/hacker-news.xsl
new file mode 100644
index 0000000..0e1fb63
--- /dev/null
+++ b/.config/pancake/unclutter/hacker-news.xsl
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:template match="/">
+ <html>
+ <body>
+ Hacker News
+ <xsl:for-each select="//td[@class='title' or @class='subtext']">
+ <xsl:choose>
+ <xsl:when test="@class = 'title'">
+ <xsl:variable name="uri" select="a/@href"/>
+ <xsl:if test="$uri!=''">
+ <br />
+ <br />
+ <a href="{$uri}" >
+ <xsl:value-of select="a" />
+ </a>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="@class = 'subtext'">
+ <br/>
+ <xsl:value-of select="span[@class='age']" />
+ |
+ <a href="{a[last()]/@href}">
+ <xsl:value-of select="a[last()]" />
+ </a>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </body>
+ </html>
+ </xsl:template>
+</xsl:stylesheet>