poldek-rss: poldekbuild.sh poldekdiff.sh
patrys
cvs at pld-linux.org
Tue Nov 8 19:49:15 CET 2005
Author: patrys
Date: Tue Nov 8 19:49:12 2005
New Revision: 6525
Added:
poldek-rss/poldekbuild.sh (contents, props changed)
Modified:
poldek-rss/poldekdiff.sh
Log:
- updated to latest version, misc RSS format fixes
Added: poldek-rss/poldekbuild.sh
==============================================================================
--- (empty file)
+++ poldek-rss/poldekbuild.sh Tue Nov 8 19:49:12 2005
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+TEMPDIR=/home/users/patrys/tmp
+DESTDIR=/srv/http/planet/poldek
+KEEPHIST=14
+POLDEK=/usr/bin/ipoldek
+
+ DATE=$(date -R)
+
+ RSS="<rss version=\"2.0\">
+ <channel>
+ <title>PLD FTP Traffic</title>
+ <link>http://pld-linux.org/</link>
+ <description>Automated FTP traffic data for PLD Linux</description>
+ <managingEditor>patrys at pld-linux.org</managingEditor>
+ <lastBuildDate>$DATE</lastBuildDate>"
+ for i in $(seq $KEEPHIST)
+ do
+ if [ -r "$TEMPDIR/poldek.$i" ]
+ then
+ ITEM=$(cat "$TEMPDIR/poldek.$i")
+ RSS="$RSS
+$ITEM"
+ fi
+ done
+ RSS="$RSS
+ </channel>
+</rss>"
+ echo "$RSS" > "$DESTDIR/poldek.rss"
+ chmod 644 "$DESTDIR/poldek.rss"
Modified: poldek-rss/poldekdiff.sh
==============================================================================
--- poldek-rss/poldekdiff.sh (original)
+++ poldek-rss/poldekdiff.sh Tue Nov 8 19:49:12 2005
@@ -1,6 +1,6 @@
#!/bin/bash
-TEMPDIR=~/tmp
+TEMPDIR=/home/users/patrys/tmp
DESTDIR=/srv/http/planet/poldek
KEEPHIST=14
POLDEK=/usr/bin/ipoldek
@@ -16,7 +16,7 @@
then
for i in $(seq $(($KEEPHIST - 1)) -1 1)
do
- if [ -e "$TEMPDIR/poldek.$i" ]
+ if [ -r "$TEMPDIR/poldek.$i" ]
then
mv "$TEMPDIR/poldek.$i" "$TEMPDIR/poldek.$(($i + 1))"
fi
@@ -24,6 +24,8 @@
DATE=$(date -R)
+ GUID=$(date '+%Y%m%d%H%M')
+
if [ -z "$ADDEDLIST" ]
then
ADDEDLIST="<li>none</li>"
@@ -36,10 +38,10 @@
THELIST="
<item>
- <guid isPermaLink=\"false\">http://pld-linux.org/</guid>
+ <guid isPermaLink=\"false\">http://pld-linux.org/#$GUID</guid>
<pubDate>$DATE</pubDate>
<title>FTP Traffic Update</title>
- <author>FTP Traffic Data</author>
+ <author>FTP Traffic Data <patrys at pld-linux.org></author>
<description>
<p>New packages as of $DATE:</p>
<ul>$ADDEDLIST</ul>
@@ -59,10 +61,11 @@
<lastBuildDate>$DATE</lastBuildDate>"
for i in $(seq $KEEPHIST)
do
- if [ -e "$TEMPDIR/poldek.$i" ]
+ if [ -r "$TEMPDIR/poldek.$i" ]
then
ITEM=$(cat "$TEMPDIR/poldek.$i")
- RSS="$RSS$ITEM"
+ RSS="$RSS
+$ITEM"
fi
done
RSS="$RSS
More information about the pld-cvs-commit
mailing list