#!/bin/csh -f # script for scanning urls of current modis products # Prof. P. Lewis, UCL # Oct 20 2013 # email: p.lewis@ucl.ac.uk # Zat is the name of a friendly robot in a John Wyndham # story, The Lost Machine (Amazing Stories, April 1932). # cd /tmp mkdir -p robot_files cd robot_files foreach f (MOTA) wget http://e4ftl01.cr.usgs.gov/MODIS_Composites/$f set products = `grep 'alt=' < $f | grep -v blank | awk -Fhref=\" '{print $2}'|awk -F/\" '{print $1}'|grep 15A2` foreach p ($products) wget http://e4ftl01.cr.usgs.gov/MODIS_Composites/$f/$p set dates = `grep 'alt=' < $p | grep -v blank | awk -Fhref=\" '{print $2}'|awk -F/\" '{print $1}'` foreach d ($dates) wget -O $p.$d http://e4ftl01.cr.usgs.gov/MODIS_Composites/$f/$p/$d grep hdf < $p.$d | grep -v xml | awk -Fhref=\" '{print $2}'|awk -F\"\> '{print w $1}' w="http://e4ftl01.cr.usgs.gov/MODIS_Composites/$f/$p/$d/" >> robot.txt end end end cat robot.txt cd /tmp rm -rf robot_files