--- nsdl/nsdlloncapaorg/harvester.pl 2003/07/29 14:37:51 1.4 +++ nsdl/nsdlloncapaorg/harvester.pl 2003/07/29 15:10:31 1.5 @@ -28,10 +28,26 @@ my $content_regex = 'File Not Found'; # Configuration my $debug = 0; -my $url = 'http://s10.lite.msu.edu/cgi-bin/metadata_harvest.pl'; + # The list of servers is from the LON-CAPA CVS repository in /loncapa/loncom/production_hosts.tab -my @servers = ( 'newscience.westshore.cc.mi.us', 's10.lite.msu.edu', 's12.lite.msu.edu', 'lon-capa.chem.sunysb.edu', 'schubert.tmcc.edu', 'dalton.chem.sfu.ca', 'capa2.phy.ohiou.edu', 'pollux.physics.fsu.edu', 'loncapa.physics.sc.edu', 'loncapa.math.ucf.edu', 'zappa.ags.udel.edu', 'loncapa.gwu.edu'); +my @servers = ( +'newscience.westshore.cc.mi.us', +'s10.lite.msu.edu', +'s12.lite.msu.edu', +'lon-capa.chem.sunysb.edu', +'schubert.tmcc.edu', +'dalton.chem.sfu.ca', +'capa2.phy.ohiou.edu', +'pollux.physics.fsu.edu', +'loncapa.physics.sc.edu', +'loncapa.math.ucf.edu', +'zappa.ags.udel.edu', +'loncapa.gwu.edu', +'neptune.physics.ndsu.nodak.edu', +'capa1.uwsp.edu'); +foreach (@servers) { + my $url='http://'.$_.'/cgi-bin/metadata_harvest.pl'; # End Configuration my $ua = new LWP::UserAgent; @@ -43,6 +59,7 @@ $request->authorization_basic('reaper', my $response = $ua->request( $request ); if ( $response->is_success ) { + print 'SUCCESS: ' . $response->message.' for '.$url."\n\n"; $content = $response->content; # Delete all blank lines $content =~ s/(?is_success ) { # Push the content into an array @loncapa = split /\n/, $content; } else { - die 'LON-CAPA request failed: ' . $response->message; + print 'LON-CAPA request failed: ' . $response->message.' for '.$url."\n\n"; + next; } #@loncapa=undef; @@ -183,3 +201,4 @@ foreach my $metadata (@loncapa) { ENDMETA close (XML); } +}