/[maps]/Maps.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Maps.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by dpavlin, Wed Oct 17 15:39:44 2007 UTC revision 12 by dpavlin, Wed Oct 17 15:50:35 2007 UTC
# Line 12  sub http_transaction { Line 12  sub http_transaction {
12      my ($req_mono)  = $args->{req_mono};    # isa Net::Analysis::TCPMonologue      my ($req_mono)  = $args->{req_mono};    # isa Net::Analysis::TCPMonologue
13      my ($resp_mono) = $args->{resp_mono};   # isa Net::Analysis::TCPMonologue      my ($resp_mono) = $args->{resp_mono};   # isa Net::Analysis::TCPMonologue
14    
15          print ">> ",$req->uri, "\n";          my $file;
   
         my $ext;  
16    
17          if ( $req->uri() =~ m!/GElin/MapSrv\.aspx\?lwM=(\d+)&twM=(\d+)&zf=(\d+)! ) {          if ( $req->uri() =~ m!/GElin/MapSrv\.aspx\?lwM=(\d+)&twM=(\d+)&zf=(\d+)! ) {
18                  # Mireo                  # Mireo
19                  $ext = 'png';                  $file = "$3/$1-$2.gif";
20          } elsif ( $req->uri() =~ m!/mt\?.*x=(\d+)&y=(\d+)&zoom=(\d+)! ) {          } elsif ( $req->uri() =~ m!/mt\?.*x=(\d+)&y=(\d+)&zoom=(\d+)! ) {
21                  # Google maps                  # Google maps
22                  $ext = 'png'                  $file = "$3/$1-$2.png";
23          } elsif ( $req->uri() =~ m!/aerial.maps.yimg.com/img.*&x=(\d+)&y=(\d+)&z=(\d+)! ) {          } elsif ( $req->uri() =~ m!/aerial.maps.yimg.com/img.*&x=(\d+)&y=(\d+)&z=(\d+)&v=1\.7! ) {
24                  $ext = 'jpg'                  # Yahoo maps
25                    $file = "$3/$1-$2.jpg";
26          }          }
27    
28          if ( $ext ) {          if ( $file ) {
29                  mkdir "dump" unless -e "dump";                  mkdir "dump" unless -e "dump";
30                  mkdir "dump/$3" unless -e "dump/$3";                  mkdir "dump/$3" unless -e "dump/$3";
31                  my $file = "dump/$3/$1-$2.$ext";                  write_file( "dump/$file", $resp->content );
32                  write_file( $file, $resp->content );                  print "$1x$2 zoom: $3 -> $file ", -s "dump/$file", " bytes\n";
33                  print "$1x$2 zoom: $3 -> $file ", -s $file, " bytes\n";          } else {
34                    print ">> ",$req->uri, "\n";
35          }          }
36    
37    
38  }  }
39    
40  1;  1;

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26