# HG changeset patch # User Christophe Lincoln # Date 1301509909 -7200 # Node ID 111573c244f6af73f56767fcf049199ee7c38728 # Parent c750cc8467b8f13cfe3ff7cc2dbe0399dfe4b7da Improbe get_feed function diff -r c750cc8467b8 -r 111573c244f6 en/index.php --- a/en/index.php Wed Mar 30 18:37:02 2011 +0200 +++ b/en/index.php Wed Mar 30 20:31:49 2011 +0200 @@ -180,7 +180,7 @@

Project Activity

@@ -188,7 +188,7 @@ users.png Community activity - +

More activity @@ -200,7 +200,7 @@ development.png Latest commits in wok - +

More commits diff -r c750cc8467b8 -r 111573c244f6 en/packages/index.php --- a/en/packages/index.php Wed Mar 30 18:37:02 2011 +0200 +++ b/en/packages/index.php Wed Mar 30 20:31:49 2011 +0200 @@ -119,14 +119,14 @@

Activity

- +

development.png Latest commits in wok - +

More commits diff -r c750cc8467b8 -r 111573c244f6 fr/index.php --- a/fr/index.php Wed Mar 30 18:37:02 2011 +0200 +++ b/fr/index.php Wed Mar 30 20:31:49 2011 +0200 @@ -97,7 +97,7 @@

Actualités du projet

Le site web de SliTaz propose les principales nouvelles du projet, et - les laboratoires des nouvelles + le blog officiel des nouvelles sur l'activité générale des différents sous-projets. Ces nouvelles sont aussi disponibles sous forme de flux XML. De même, le projet propose une petite lettre d'information mensuelle et @@ -108,9 +108,7 @@

news.png - Nouvelles des Labs - (flux) - news.png + Nouvelles du Blog | Lettre d'information
@@ -318,7 +316,7 @@

Activité du projet

@@ -326,7 +324,7 @@ users.png Activité de la communauté - +

Plus d'activité @@ -338,7 +336,7 @@ development.png Derniers commits dans le wok - +

Plus de commits diff -r c750cc8467b8 -r 111573c244f6 index.php --- a/index.php Wed Mar 30 18:37:02 2011 +0200 +++ b/index.php Wed Mar 30 20:31:49 2011 +0200 @@ -104,7 +104,7 @@

Project Activity

@@ -112,7 +112,7 @@ users.png Community activity - +

More activity @@ -124,7 +124,7 @@ development.png Latest commits in wok - +

More commits diff -r c750cc8467b8 -r 111573c244f6 libs/get-feed.php --- a/libs/get-feed.php Wed Mar 30 18:37:02 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -\n

\n"; - echo "Missing feed: $feed_url\n" . "
\n"; - } - else { - $content = file_get_contents($feed_url); - $x = new SimpleXmlElement($content); - $entries = 4; - $count = 0; - // We look for last item, channel may not have a PubDate* - $up = ($x->channel->item->pubDate); - echo "Updated: " . substr("$up", 5, 17) . "\n"; - echo "

\n
\n\n"; - } -} -?> diff -r c750cc8467b8 -r 111573c244f6 libs/get-feeds.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/get-feeds.php Wed Mar 30 20:31:49 2011 +0200 @@ -0,0 +1,62 @@ +\n
\n"; + echo "Missing feed: $cache/$feed\n" . "
\n"; + } + else { + $content = file_get_contents("$cache/$feed"); + $x = new SimpleXmlElement($content); + $count = 0; + // We look for last item, channel may not have a PubDate* + $up = ($x->channel->item->pubDate); + echo "Updated: " . substr("$up", 5, 17) . "\n"; + echo "

\n
\n
    \n"; + foreach($x->channel->item as $entry) { + $count = $count + 1; + echo "
  • " . + $entry->title . "
  • \n"; + if ($count == $entries) { + break; + } + } + echo "
\n"; + } +} + +// Read Blog RSS Feed +function get_feed_blog($feed) { + $cache = '/var/cache/slitaz/website'; + $entries = 4; + // have the page displayed even if any xml file + if ( ! file_exists("$cache/$feed")) { + echo "Missing feed: $cache/$feed\n" . "
\n"; + } + else { + $content = file_get_contents("$cache/$feed"); + $x = new SimpleXmlElement($content); + $count = 0; + // We look for last item, channel may not have a PubDate* + $up = ($x->channel->item->pubDate); + + echo "\n"; + } +} + +?> diff -r c750cc8467b8 -r 111573c244f6 libs/get-feeds.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libs/get-feeds.sh Wed Mar 30 20:31:49 2011 +0200 @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Get latest commits and feeds to display on the website main page. +# On Tank, this script is executed by cron each hour. +# + +URL="http://hg.slitaz.org/wok" +PKGS="/home/slitaz/cooking/packages" +CACHE="/var/cache/slitaz/website" +OUTPUT="$CACHE/latest.html" + +# Feeds URL +SCN_FEED='http://scn.slitaz.org/activity/feed/' +BLOG_FEED='http://scn.slitaz.org/category/news/feed/' +WOK_FEED='http://hg.slitaz.org/wok/rss-log' + +# Clean cache +mkdir -p $CACHE && cd $CACHE +rm -f *.xml + +# Cache all feeds to save bandwidth (updated by cron) +echo -n "Getting latest rss feeds... " +wget -O scn.xml $SCN_FEED 2>/dev/null +wget -O wok.xml $WOK_FEED 2>/dev/null +wget -O blog.xml $BLOG_FEED 2>/dev/null +echo "Done" + diff -r c750cc8467b8 -r 111573c244f6 libs/get-latest.sh --- a/libs/get-latest.sh Wed Mar 30 18:37:02 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -#!/bin/sh -# -# Get latest commits and packages to display on the website main page. -# On Tank, this script is executed by cron each hour. -# - -REPO="/home/slitaz/repos/wok" -URL="http://hg.slitaz.org/wok" -PKGS="/home/slitaz/cooking/packages" -CACHE="/var/cache/slitaz/website" -OUTPUT="$CACHE/latest.html" - -# Feed URLs -SCN_FEED='http://scn.slitaz.org/activity/feed/' -DOC_FEED='http://doc.slitaz.org/feed.php' -FORUM_FEED='http://forum.slitaz.org/rss/' -BUGS_FEED='http://labs.slitaz.org/issues.atom?query_id=' -WOK_FEED='http://hg.slitaz.org/wok/rss-log' - -# Clean cache -mkdir -p $CACHE && cd $CACHE -rm *.xml - -# Cache all feeds to save bandwidth (updated by cron) -#wget -O doc.xml $DOC_FEED -#wget -O forum.xml $FORUM_FEED -#wget -O bugs.xml $BUGS_FEED -wget -O scn.xml $SCN_FEED -wget -O wok.xml $WOK_FEED - -# Latest cooked packages by the build bot. -#echo -n "Getting latest cooked packages... " -#echo '' >> $OUTPUT -#echo "Done"