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
       $url =~ s/&/&/g;
194
       $url =~ s/&/&/g;
195
       print $fout "<h2><a href=\"$url\">$title</a></h2>\n";
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
 	print $fout "<p class=\"missing\">Ruokalistaa ei saatavilla.</p>";
198
 	print $fout "<p class=\"missing\">Ruokalistaa ei saatavilla.</p>";
199
 	next;
199
 	next;
200
       }
200
       }

+ 5 - 0
sodexo.pl View File

128
   @cur_day_foods = ();
128
   @cur_day_foods = ();
129
   @week_foods = ();
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
   $parse_func = \&sodexo_parse_to_week;
136
   $parse_func = \&sodexo_parse_to_week;
132
   while (my $token = $p->get_token) {
137
   while (my $token = $p->get_token) {
133
     &$parse_func($token);
138
     &$parse_func($token);