#!/usr/bin/perl

# get Google map tiles; A.Daviel TRIUMF Aug 2007

# paste URL list from Mozilla "show page info" media tab into STDIN
# for best results, use google.com khcookie from Mozilla cookie manager

# Note - Google maps and satellite images are copyright. Depending on jurisdiction,
# you may be able to make single copies for private use or research purposes

while (<STDIN>) {
  chomp ;
  $url = $_ ;
  if (/http:.*t=([\w]+)/) {
    $jpg = "$1.jpg" ;
    print "save $url as $jpg\n" ;
    system("wget --load-cookies cookies.txt  -U Mozilla -O $jpg \"$url\"") ;
  }
}
