start aggregating feeds for portal
parent
bfa9b0f147
commit
decbdfc67b
@ -0,0 +1,6 @@
|
||||
<config>
|
||||
<gallery id="media-lachmoewe">https://media.c3d2.de/u/lachmoewe/atom/</gallery>
|
||||
<gallery id="media-bigalex">https://media.c3d2.de/u/bigalex/atom/</gallery>
|
||||
<gallery id="media-joerg">https://media.c3d2.de/u/joerg/atom/</gallery>
|
||||
<wiki id="wiki">https://wiki.c3d2.de/w/index.php?title=Spezial:Letzte_%C3%84nderungen&feed=atom&days=60&limit=30</wiki>
|
||||
</config>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output method="text" encoding="utf-8"/>
|
||||
|
||||
<xsl:template match="/config">
|
||||
<xsl:text>#!/bin/sh </xsl:text>
|
||||
<xsl:apply-templates select="*[@id]"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/config/*">
|
||||
<xsl:text>wget -O portal-</xsl:text>
|
||||
<xsl:value-of select="@id"/>
|
||||
<xsl:text>.xml '</xsl:text>
|
||||
<xsl:value-of select="string(.)"/>
|
||||
<xsl:text>' </xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns:atom="http://www.w3.org/2005/Atom"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
|
||||
|
||||
<xsl:template match="/config">
|
||||
<portal>
|
||||
<xsl:apply-templates select="*[@id]"/>
|
||||
<xsl:for-each select="document('../news.xml')//newsfile">
|
||||
<xsl:apply-templates select="document(concat('../', .))/item" mode="news">
|
||||
<xsl:with-param name="link"
|
||||
select="concat(substring-before(., '.xml'), '.html')"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
</portal>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/config/gallery">
|
||||
<xsl:apply-templates select="document(concat('../portal/portal-', @id, '.xml'))/atom:feed/atom:entry" mode="gallery"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/config/wiki">
|
||||
<xsl:apply-templates select="document(concat('../portal/portal-', @id, '.xml'))/atom:feed/atom:entry" mode="wiki"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="atom:entry" mode="gallery">
|
||||
<item>
|
||||
<header><xsl:value-of select="atom:title"/></header>
|
||||
<footer><xsl:value-of select="atom:content[@type='html']" disable-output-escaping="yes"/></footer>
|
||||
<date><xsl:value-of select="atom:updated"/></date>
|
||||
<content-image><xsl:value-of select="atom:link[@rel='enclosure'][1]/@href"/></content-image>
|
||||
<link><xsl:value-of select="atom:link[@rel='alternate'][1]/@href"/></link>
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="atom:entry" mode="wiki">
|
||||
<item>
|
||||
<header>C3D2 Wiki</header>
|
||||
<footer>by <xsl:value-of select="atom:author/atom:name"/></footer>
|
||||
<date><xsl:value-of select="atom:updated"/></date>
|
||||
<content-text>[[<xsl:value-of select="atom:title"/>]]</content-text>
|
||||
<link><xsl:value-of select="atom:link[@rel='alternate'][1]/@href"/></link>
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="item" mode="news">
|
||||
<xsl:param name="link"/>
|
||||
|
||||
<item>
|
||||
<header>News</header>
|
||||
<footer>by <xsl:value-of select="@author"/></footer>
|
||||
<date><xsl:value-of select="@date"/></date>
|
||||
<content-text><xsl:value-of select="@title"/></content-text>
|
||||
<xsl:apply-templates select="image[1]" mode="news"/>
|
||||
<link><xsl:value-of select="$link"/></link>
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="image" mode="news">
|
||||
<content-image>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains(., '//')"></xsl:when>
|
||||
<xsl:otherwise>images/news/</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:value-of select="."/>
|
||||
</content-image>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
Loading…
Reference in New Issue