# HG changeset patch # User paulo@thepaulopc # Date 1308814879 25200 # Node ID 28221b9bb370329139f0b80e13c84c83c5d69c50 # Parent f93693980ead2747c6b72c3ab7badef1fde45d10 add weather/; update myrss/FEEDS; add umask(0037) to weather/index.php and myrss/index.php diff -r f93693980ead -r 28221b9bb370 myrss/FEEDS --- a/myrss/FEEDS Sat Jun 04 22:20:26 2011 -0700 +++ b/myrss/FEEDS Thu Jun 23 00:41:19 2011 -0700 @@ -6,6 +6,7 @@ http://feeds.sfgate.com/sfgate/rss/feeds/blogs/sfgate/warriors/index_rss2 http://sports.yahoo.com/top/rss.xml http://sports.yahoo.com/blogs/rss.xml +http://www.grantland.com/feed http://rss.slashdot.org/Slashdot/slashdot http://www.reddit.com/.rss http://services.digg.com/2.0/story.getTopNews?type=rss diff -r f93693980ead -r 28221b9bb370 myrss/index.php --- a/myrss/index.php Sat Jun 04 22:20:26 2011 -0700 +++ b/myrss/index.php Thu Jun 23 00:41:19 2011 -0700 @@ -1,4 +1,6 @@ + +Weather + + + + + + 0) + $cache_mtime = filemtime($cache_fn); + +$newbody = ''; + +if ((time() - $cache_mtime >= $cache_life)) { + $newbody = shell_exec('./getweather.sh'); + file_put_contents($cache_fn, $newbody); +} else { + $newbody = file_get_contents($cache_fn); +} + +$end_time = microtime(true); +$elapsed_time = $end_time - $start_time; + +echo "
";
+echo $newbody;
+echo "
"; + +echo "
Time elapsed: " . sprintf("%.3f", $elapsed_time) . " seconds.
"; +?> + + +