This shell script is added as a cronjob running every minute. The resulting file is available at https://files.jankoppe.de/36c3/chaos-west-schedule-filtered.xml
Last active
December 9, 2019 11:59
-
-
Save JanKoppe/1018fcfe33667df5c0bb313a7502ea9c to your computer and use it in GitHub Desktop.
36C3: Pretalx XML filter out track
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
# requires curl and xmlstarlet | |
/usr/bin/curl https://fahrplan.chaos-west.de/36c3/schedule/export/schedule.xml -s | /usr/bin/xmlstarlet tr /root/filter_fahrplan.xsl - > /mnt/data/files-jankoppe.de/36c3/chaos-west-schedule-filtered.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:theia="http://www.theia.org.uk/ILR/2011-12/1"> | |
<!-- identity template --> | |
<xsl:template match="@* | node()"> | |
<xsl:copy> | |
<xsl:apply-templates select="@*|node()"/> | |
</xsl:copy> | |
</xsl:template> | |
<!-- filter based on track value; omit Klangteppich track events --> | |
<xsl:template match="schedule/day/room/event[track = 'Klangteppich']"></xsl:template> | |
</xsl:stylesheet> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment