X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=public_html%2Fcgi-bin%2Faladin;fp=public_html%2Fcgi-bin%2Faladin;h=01252535455a795497e96ae26de6ac2b191eec3f;hp=0000000000000000000000000000000000000000;hb=6ec3d7f63883f8a0d85bedcc0d4a673aab80055a;hpb=0732ee1c617780fa98605c30b2c25e1781ff1edb diff --git a/public_html/cgi-bin/aladin b/public_html/cgi-bin/aladin new file mode 100755 index 0000000..0125253 --- /dev/null +++ b/public_html/cgi-bin/aladin @@ -0,0 +1,70 @@ +#! /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