rev 5072 - www/v2
Sune Vuorela
pusling-guest at alioth.debian.org
Tue Dec 5 13:13:24 CET 2006
Author: pusling-guest
Date: 2006-12-05 13:13:24 +0100 (Tue, 05 Dec 2006)
New Revision: 5072
Added:
www/v2/genrss.sh
Modified:
www/v2/genweb.sh
Log:
wow!
Don't read this commit. it is ugly - but we might have rss now.
Added: www/v2/genrss.sh
===================================================================
--- www/v2/genrss.sh 2006-12-05 10:40:33 UTC (rev 5071)
+++ www/v2/genrss.sh 2006-12-05 12:13:24 UTC (rev 5072)
@@ -0,0 +1,42 @@
+#! /bin/sh -e
+
+FILE=pages/index
+
+NEWS_START=`grep -n "<h2>Latest" ${FILE} | sed 's/:.*//'`
+
+NEWS_START=`echo ${NEWS_START}+1|bc`
+
+NEWS_END=`tail -n +${NEWS_START} ${FILE} | grep -n "<h2>" | sed 's/:.*//'`
+
+if [ -z "${NEWS_END}" ]
+then
+ NEWS_END=`tail -n +${NEWS_START} ${FILE} | wc --lines`
+else
+ NEWS_END=`echo ${NEWS_END}-1|bc`
+fi
+
+cat <<__EOHEAD__
+<?xml version="1.0" encoding="iso-8859-1"?>
+<rss version="2.0">
+ <channel>
+ <title>Debian KDE maintainers</title>
+ <description>Debian KDE news feed</description>
+ <link>http://pkg-kde.alioth.debian.org/</link>
+ <lastBuildDate>`date -R`</lastBuildDate>
+ <generator>bash hacking</generator>
+ <image>
+ <url>http://pkg-kde.alioth.debian.org/images/KDEbian2-60x60.png</url>
+ <title>Debian KDE maintainers</title>
+ <link>http://pkg-kde.alioth.debian.org/</link>
+ <description>Debian KDE news feed</description>
+ </image>
+__EOHEAD__
+
+tail -n +${NEWS_START} ${FILE} | head -n +${NEWS_START} | sed 's,<p>,<item>,g;s,</p>,</item>,g;s,<strong>,<title>,g;s,</strong>,</title>,g;s,<br />,<link>http://pkg-kde.alioth.debian.org/</link>,g'
+
+cat << __EOFOOT__
+ </channel>
+</rss>
+
+__EOFOOT__
+
Modified: www/v2/genweb.sh
===================================================================
--- www/v2/genweb.sh 2006-12-05 10:40:33 UTC (rev 5071)
+++ www/v2/genweb.sh 2006-12-05 12:13:24 UTC (rev 5072)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -e
OUTPUT=output
rm -rf pages/*~ output/*
@@ -16,4 +16,6 @@
cat pages/bottom >> $OUTPUT/$i.html
done
+sh genrss.sh > $OUTPUT/rss.xml
+
chmod -R g+w $OUTPUT/*
More information about the pkg-kde-commits
mailing list