Difference between revisions of "Main Page/Research/MSB/Scripts/msb.get.data.pl"

From phurvitz
< Main Page‎ | Research‎ | MSB‎ | Scripts
Jump to: navigation, search
 
 
(3 intermediate revisions by the same user not shown)
(No difference)

Latest revision as of 16:51, 27 January 2009

msb.get.data.pl

#! /usr/bin/perl -w

# gets the MSB data
# URL of the form
# http://www.cs.washington.edu/research/projects/ubicomp3/phurvitz/gis.washington.edu/phurvitz/msb/data/pmh07/part_00


# first arg should be the URL
if ($#ARGV != 0) {
  print "Usage: $0 <URL to download>\ne.g., $0 pmh07\n";
  exit;
}

# change to the correct dir
if ("$^O" eq "linux" ) {
    chdir "/d1/phurvitz/public_html/msb/processed_data/processed";
    $pwd = `pwd`;
}
elsif ("$^O" eq "MSWin32") {
    chdir "/users/phurvitz/htdocs/phurvitz/msb/processed_data";
    $pwd = `pwd`;
}

# download
system "wget -np -r -nH -N --accept=png,csv,kml --reject=html,htm,txt \
   --http-user=phurvitz --http-passwd=phurvitz \ 
   http://www.cs.washington.edu/research/projects/ubicomp3/phurvitz/gis.washington.edu/phurvitz/msb/data/$ARGV[0]";

#system "wget -np -r -nH -N --accept=png,csv,kml --reject=html,htm,txt \
   --http-user=phurvitz --http-passwd=phurvitz \
    http://www.cs.washington.edu/research/projects/ubicomp3/phurvitz/gis.washington.edu/phurvitz/msb/data/$ARGV[0]/part_00";

# report
print "\nsee http://gis.washington.edu/phurvitz/msb/processed_data/downloaded_data/$ARGV[0]\n";