--- nsdl/nsdlloncapaorg/harvester.pl 2003/07/29 14:13:36 1.3 +++ nsdl/nsdlloncapaorg/harvester.pl 2003/07/29 14:37:51 1.4 @@ -12,6 +12,9 @@ use strict; use LWP::UserAgent; use Getopt::Std; use Digest::MD5 qw(md5_hex); +use IO::File; + +my $basepath='/home/httpd/cgi-bin/OAI-XMLFile/XMLFile/nsdlexport/data'; my $pub_month; my $pub_year; @@ -60,7 +63,6 @@ if ( $response->is_success ) { #} my %records = ();; -print ''."\n\n"; foreach my $metadata (@loncapa) { chomp $metadata; @@ -84,8 +86,10 @@ foreach my $metadata (@loncapa) { next if ( ($subject eq 'Sample') || ($subject eq 'Something') ); my $resourceurl = 'http://nsdl.lon-capa.org' . $tkline[3]; my $baseid=$tkline[3]; + my ($adom,$auname)=($baseid=~/^\/res\/(\w+)\/(\w+)\//); $baseid=~s/\W/\_/g; $baseid=~s/^\_res\_//g; + my $fileid=md5_hex($baseid); next if ( $resourceurl =~ /(.*)\/demo\/(.*)/ ); my $keywords = $tkline[4]; @@ -150,7 +154,17 @@ foreach my $metadata (@loncapa) { # Private means open only to author of material next if ( $copyright eq 'private'); my $platform = "5"; # HTML Browser (not specified but construed from metadata) - print (<'.$basepath.'/'.$adom.'/'.$auname.'/'.$baseid.'.xml'); + print XML (< + $abstract $rev_year-$rev_month-$rev_day - ENDMETA + close (XML); }