Skip to content
Snippets Groups Projects
Commit a56eda3f authored by Michael Gebhard's avatar Michael Gebhard
Browse files

Merge remote-tracking branch 'rk/master'

parents 8b6de07f 26929f28
Branches master
No related tags found
No related merge requests found
......@@ -25,5 +25,8 @@ cd /home/cip/adm/im72ywil-roadkill/proj/hunger/
echo '<h3>Cafebar</h3>'
xmllint --html --xpath '//table[@class="oeffnungszeiten"]' "http://www.werkswelt.de/index.php?id=cafebar-suedmensa" 2>/dev/null
echo '<h3>Rommel</h3>'
xmllint --html --xpath '//table[@class="oeffnungszeiten"]' "http://www.werkswelt.de/index.php?id=suedblick" 2>/dev/null
echo '</body></html>'
) >hungerraw.html
......@@ -19,6 +19,7 @@ sub start {
if ($tagname eq "h3") {
$$elem->attr('style', "margin:2em 0 0.5em 0;color:#aaaaaa");
} elsif ($tagname eq "table") {
finish_times_without_semesterferien();
$sffrom = "";
$sfto = "";
$$elem->attr('style', "border-collapse:collapse;background:#ffffff;border:1px solid #ffffff;color:#aaaaaa");
......@@ -129,12 +130,13 @@ sub text {
# semester termine come first, push them to temporary valid_semester_times
push @valid_semester_times, $elem;
} elsif (DateTime->compare(DateTime->from_epoch(epoch=>str2time($sffrom)), $now) < 0 and DateTime->compare($now, DateTime->from_epoch(epoch=>str2time($sfto))) < 0) {
# we are in semesterferien, discard semester terimne
# we are in semesterferien, discard semester termine
@valid_semester_times = ();
push @valid_times, $elem;
} else {
# we are in semester, make semester termine persistent
push @valid_times, @valid_semester_times;
@valid_semester_times = ();
}
}
}
......@@ -143,6 +145,11 @@ sub text {
}
}
sub finish_times_without_semesterferien {
push @valid_times, @valid_semester_times;
@valid_semester_times = ();
}
sub find_parent {
my ($elem, $tag) = @_;
while (1) {
......@@ -176,6 +183,7 @@ while (1) {
}
}
}
finish_times_without_semesterferien();
my @open_mensas;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment