9 if (exists $ENV{"QUERY_STRING"}) {
10 $BASE=($ENV{"QUERY_STRING"}=~m{^url=([^&]*)})[0];
11 $BASE=URI::Escape::uri_unescape($BASE);
12 0==@ARGV or die "ARGV count != 0";
16 1==@ARGV or die "ARGV count != 1";
20 if ($ENV{"GATEWAY_INTERFACE"}) {
22 Content-type: text/html; charset=windows-1250
28 <title>iDNES foto@{[ (!$BASE ? "" : ": $BASE") ]}</title>
29 <meta http-equiv="Content-Type" content="text/html; charset=windows-1250">
31 <form action="idnes-foto" method="get">
32 <input type="text" name="url" size="50" value="$BASE">
36 $BASE=~m{^http://\w+\Q.idnes.cz/foto.asp?\E(?:r=\w+&c=\w+|c=\w+&r=\w+)$} or $BASE="";
42 my $pageurl=$BASE.'&strana='.$pageno;
43 my $page=LWP::Simple::get($pageurl) or die $pageurl;
45 while ($page=~m{<img src="(http://(?:\Qi.idnes.cz\E/\d{2}/\d{3}|\Qimgs.idnes.cz\E/\w+))(/midi)?/([-\w]+.jpg)" }gi) {
47 my($start,$mid,$base)=($1,$2,$3);
48 last PAGES if $seen{$base}++;
49 # FIXME: Sometimes "/maxi" does not exist.
51 $base=~s/_1M.JPG$/_V.JPG/;
52 my $maxi=$start.($mid||"")."/".$base;
55 <img src="$maxi" border="0">
57 my $infourl=$BASE.'&styl=zoom&foto='.$base;
58 my $info=LWP::Simple::get($infourl) or die $infourl;
59 $info=~m{<p>[^<]*</p>} or die "No text found: $infourl";
61 print <<"EOH" if !$seen_p_text{$p_text}++;
65 die $pageurl if !$did;