Ver código fonte

Fix sodexo food-bug.

Toni Fadjukoff 12 anos atrás
pai
commit
5fe3bc5e23
2 arquivos alterados com 6 adições e 1 exclusões
  1. 1 1
      food.pl
  2. 5 0
      sodexo.pl

+ 1 - 1
food.pl Ver arquivo

@@ -194,7 +194,7 @@ sub write_day {
194 194
       $url =~ s/&/&/g;
195 195
       print $fout "<h2><a href=\"$url\">$title</a></h2>\n";
196 196
       
197
-      if ($title =~ /Sodexo/ || !defined($week_foods[$day])) {
197
+      if (!defined($week_foods[$day])) {
198 198
 	print $fout "<p class=\"missing\">Ruokalistaa ei saatavilla.</p>";
199 199
 	next;
200 200
       }

+ 5 - 0
sodexo.pl Ver arquivo

@@ -128,6 +128,11 @@ sub parse_sodexo {
128 128
   @cur_day_foods = ();
129 129
   @week_foods = ();
130 130
 
131
+  my $week_day = `date +%w`;
132
+  for (my $i = 1; $i < $week_day; ++$i) {
133
+    sodexo_finish_day();
134
+  }
135
+
131 136
   $parse_func = \&sodexo_parse_to_week;
132 137
   while (my $token = $p->get_token) {
133 138
     &$parse_func($token);