Browse Source

Fix sodexo food-bug.

Toni Fadjukoff 12 years ago
parent
commit
5fe3bc5e23
2 changed files with 6 additions and 1 deletions
  1. 1 1
      food.pl
  2. 5 0
      sodexo.pl

+ 1 - 1
food.pl View File

@@ -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 View File

@@ -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);