website view libs/get-latest.sh @ rev 780

ex + id: Code clean-up and new layout (TODO: finish es)
author Christophe Lincoln <pankso@slitaz.org>
date Sat Mar 26 22:22:15 2011 +0100 (2011-03-26)
parents 28f1deaca1b4
children b88062412123
line source
1 #!/bin/sh
2 #
3 # Get latest commits and packages to display on the website main page.
4 # On Tank, this script is executed by cron each hour.
5 #
7 REPO="/home/slitaz/repos/wok"
8 URL="http://hg.slitaz.org/wok"
9 PKGS="/home/slitaz/cooking/packages"
10 CACHE="/var/cache/slitaz/website"
11 OUTPUT="$CACHE/latest.html"
13 # Feed URLs
14 SCN_FEED='http://scn.slitaz.org/rss.xml'
15 DOC_FEED='http://doc.slitaz.org/feed.php'
16 FORUM_FEED='http://forum.slitaz.org/index.php?p=/discussions/feed.rss'
17 BUGS_FEED='http://labs.slitaz.org/issues.atom?query_id='
18 WOK_FEED='http://hg.slitaz.org/wok/rss-log'
20 # Clean cache
21 mkdir -p $CACHE && cd $CACHE
22 rm *.xml
24 # Cache all feeds to save bandwidth (updated by cron)
25 wget -O scn.xml $SCN_FEED
26 wget -O doc.xml $DOC_FEED
27 wget -O forum.xml $FORUM_FEED
28 wget -O bugs.xml $BUGS_FEED
29 wget -O wok.xml $WOK_FEED
31 # Latest cooked packages by the build bot.
32 echo -n "Getting latest cooked packages... "
33 echo '<ul>' > $OUTPUT
34 cd $PKGS && ls -1t *.tazpkg | head -8 | \
35 while read file
36 do
37 echo -n ' <li>'$(stat -c '%y' $PKGS/$file | \
38 cut -d ' ' -f 1); echo " - $file</li>"
39 done >> $OUTPUT
40 echo '</ul>' >> $OUTPUT
41 echo "Done"