version 1.4, 2003/07/29 14:37:51
|
version 1.5, 2003/07/29 15:10:31
|
Line 28 my $content_regex = 'File Not Found';
|
Line 28 my $content_regex = 'File Not Found';
|
# Configuration |
# Configuration |
|
|
my $debug = 0; |
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 |
# 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 |
# End Configuration |
|
|
my $ua = new LWP::UserAgent; |
my $ua = new LWP::UserAgent; |
Line 43 $request->authorization_basic('reaper',
|
Line 59 $request->authorization_basic('reaper',
|
my $response = $ua->request( $request ); |
my $response = $ua->request( $request ); |
|
|
if ( $response->is_success ) { |
if ( $response->is_success ) { |
|
print 'SUCCESS: ' . $response->message.' for '.$url."\n\n"; |
$content = $response->content; |
$content = $response->content; |
# Delete all blank lines |
# Delete all blank lines |
$content =~ s/(?<!.)\n//g; |
$content =~ s/(?<!.)\n//g; |
Line 51 if ( $response->is_success ) {
|
Line 68 if ( $response->is_success ) {
|
# Push the content into an array |
# Push the content into an array |
@loncapa = split /\n/, $content; |
@loncapa = split /\n/, $content; |
} else { |
} else { |
die 'LON-CAPA request failed: ' . $response->message; |
print 'LON-CAPA request failed: ' . $response->message.' for '.$url."\n\n"; |
|
next; |
} |
} |
|
|
#@loncapa=undef; |
#@loncapa=undef; |
Line 183 foreach my $metadata (@loncapa) {
|
Line 201 foreach my $metadata (@loncapa) {
|
ENDMETA |
ENDMETA |
close (XML); |
close (XML); |
} |
} |
|
} |