diff options
Diffstat (limited to 'includes')
-rwxr-xr-x | includes/fetch-news.sh | 8 | ||||
-rw-r--r-- | includes/news.php | 11 |
2 files changed, 17 insertions, 2 deletions
diff --git a/includes/fetch-news.sh b/includes/fetch-news.sh new file mode 100755 index 0000000..02c11b2 --- /dev/null +++ b/includes/fetch-news.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# +# Fetches project news and saves it for local use. +# + +/usr/bin/wget -q -O /home/groups/t/th/themanaworld/htdocs/includes/rss2_projnews.tmp 'http://sourceforge.net/export/rss2_projnews.php?group_id=106790&rss_fulltext=1' > /dev/null +/bin/mv -f /home/groups/t/th/themanaworld/htdocs/includes/rss2_projnews.tmp \ + /home/groups/t/th/themanaworld/htdocs/includes/rss2_projnews.cache diff --git a/includes/news.php b/includes/news.php index 52ad91e..f064b62 100644 --- a/includes/news.php +++ b/includes/news.php @@ -3,11 +3,18 @@ // This code uses the "DOM XML" extension, which is only available with PHP 4. // Be sure to update it to use the "XML", "DOM" or "XMLReader" extensions when // SF upgrades to PHP 5. +// +// The news is cached locally using a cronjob which runs in the 9th minute of +// every hour: +// +// 9 * * * * /home/groups/t/th/themanaworld/htdocs/includes/fetch-news.sh +// -$feedurl = "http://sourceforge.net/export/rss2_projnews.php?group_id=106790&rss_fulltext=1"; +//$feedurl = "http://sourceforge.net/export/rss2_projnews.php?group_id=106790&rss_fulltext=1"; +$feedurl = "includes/rss2_projnews.cache"; if (!$dom = domxml_open_file($feedurl)) { - echo "Error while fetching news feed.\n"; + echo "Error while opening news feed.\n"; exit; } |