Ticket #8466: weather.patch
File weather.patch, 3.7 KB (added by , 14 years ago) |
---|
-
mythweather/mythweather/scripts/ca_envcan/envcan.pl
92 92 my $getData = 1; 93 93 if (open(CACHE, "$dir/envcan_$loc")) { 94 94 ($nextupdate, $creationdate) = split / /, <CACHE>; 95 if (Date_Cmp($nextupdate, " today") > 0) { # use cache95 if (Date_Cmp($nextupdate, "now") > 0) { # use cache 96 96 no strict "vars"; 97 97 %results = eval <CACHE>; 98 98 … … 120 120 # cache is good for 15 minutes 121 121 my $newmin = 15; 122 122 123 $nextupdate = DateCalc(" today", "+ $newmin minutes");124 print CACHE UnixDate($nextupdate, "%O ") . UnixDate(" today", "%O\n");123 $nextupdate = DateCalc("now", "+ $newmin minutes"); 124 print CACHE UnixDate($nextupdate, "%O ") . UnixDate("now", "%O\n"); 125 125 print CACHE Data::Dumper->Dump([\%results], ['*results']); 126 126 } 127 127 -
mythweather/mythweather/scripts/us_nws/ndfd.pl
96 96 # We don't have to check the start/end dates, since we get the same chunk 97 97 # every time, and we update the cache atleast every hour, which is how often the 98 98 # data is updated by the NWS. 99 if (Date_Cmp($nextupdate, " today") > 0) { # use cache99 if (Date_Cmp($nextupdate, "now") > 0) { # use cache 100 100 no strict "vars"; # because eval doesn't scope var correctly 101 101 $result = eval <CACHE>; 102 102 if ($result) { … … 118 118 $Data::Dumper::Indent = 0; 119 119 # NDFD is updated by 45 minutes after the hour, we'll give them until 50 to 120 120 # make sure 121 my $min = UnixDate(" today", "%M");121 my $min = UnixDate("now", "%M"); 122 122 my $newmin; 123 123 if ($min < 50) { 124 124 $newmin = 50-$min; 125 125 } else { 126 126 $newmin = 60-($min-50); 127 127 } 128 $nextupdate = DateCalc(" today", "+ $newmin minutes");129 print CACHE UnixDate($nextupdate, "%O ") . UnixDate(" today", "%O\n");128 $nextupdate = DateCalc("now", "+ $newmin minutes"); 129 print CACHE UnixDate($nextupdate, "%O ") . UnixDate("now", "%O\n"); 130 130 print CACHE Dumper($result); 131 131 } 132 132 -
mythweather/mythweather/scripts/us_nws/ndfd18.pl
93 93 # We don't have to check the start/end dates, since we get the same chunk 94 94 # every time, and we update the cache atleast every hour, which is how often the 95 95 # data is updated by the NWS. 96 if (Date_Cmp($nextupdate, " today") > 0) { # use cache96 if (Date_Cmp($nextupdate, "now") > 0) { # use cache 97 97 no strict "vars"; # because eval doesn't scope var correctly 98 98 $result = eval <CACHE>; 99 99 if ($result) { … … 115 115 $Data::Dumper::Indent = 0; 116 116 # NDFD is updated by 45 minutes after the hour, we'll give them until 50 to 117 117 # make sure 118 my $min = UnixDate(" today", "%M");118 my $min = UnixDate("now", "%M"); 119 119 my $newmin; 120 120 if ($min < 50) { 121 121 $newmin = 50-$min; 122 122 } else { 123 123 $newmin = 60-($min-50); 124 124 } 125 $nextupdate = DateCalc(" today", "+ $newmin minutes");126 print CACHE UnixDate($nextupdate, "%O ") . UnixDate(" today", "%O\n");125 $nextupdate = DateCalc("now", "+ $newmin minutes"); 126 print CACHE UnixDate($nextupdate, "%O ") . UnixDate("now", "%O\n"); 127 127 print CACHE Dumper($result); 128 128 } 129 129 my $index = 0;