#! /usr/bin/perl use strict; use warnings; use LWP::Simple; use HTML::Entities; binmode STDOUT,":utf8"; $|=1; my $args; if (exists $ENV{"QUERY_STRING"}) { 0==@ARGV or die "ARGV count != 0"; $args=$ENV{"QUERY_STRING"}; } else { 1==@ARGV or die "ARGV count != 1"; $args=$ARGV[0]; } my $URL="http://pr-asv.chmi.cz/aladin/index.php?$args"; my $URLhtml=encode_entities $URL; if ($ENV{"GATEWAY_INTERFACE"}) { print <<"EOH"; Content-type: text/html; charset=utf8 Pragma-directive: no-cache Cache-directive: no-cache Cache-control: no-cache Pragma: no-cache Expires: 0 EOH } print <<"EOH";
",map(sprintf(" | %02dh | ",$_*6),0..3),"
---|---|
$day | \n"; if (!$days) { unshift @day,"" while @day<4; } else { push @day,"" while @day<4; } print "$_ | \n" for @day; print "
([^<>]*) .*? | \s*(?:]+))}gs) { if ($day ne $1) { flushday() if @day; $day=$1; } push @day,$3||""; } flushday(); print <<"EOH"; |
EOF
EOH