+function getLastUpdated(){
+ global $last_updated_file, $current_time;
+ $last = $current_time;
+
+ if (file_exists($last_updated_file) &&
+ ($file = fopen($last_updated_file, 'r'))) {
+ $last = fgets($file);
+ } else {
+ print "$last_updated_file doesn't exit. Trying to create it...\n";
+ $file = fopen($last_updated_file, 'w+') or
+ die("Can't open $last_updated_file for writing!\n");
+ print 'Success. Using current time (' . date('r', $last) .
+ ") to look for new notices.\n";
+ }
+
+ fclose($file);
+ return $last;