Index: trunk/install/perl/getxml2db.pl =================================================================== --- trunk/install/perl/getxml2db.pl (リビジョン 79) +++ trunk/install/perl/getxml2db.pl (リビジョン 82) @@ -19,4 +19,5 @@ use DBI; use DBD::Pg; +use Digest::MD5 qw(md5_hex); $path = $0; @@ -55,11 +56,20 @@ #$dbh->{AutoCommit} = 0; -my ($content) = get("$uri"); -if ($content eq ""){ -&writelog("getxml2db no responce from $uri, exit:"); - exit;#しょぼかるが落ちているなど -} - -my (@line) = split(/\n/, $content); +# If-Modified-Since使うように変更#2008/11/14 +my $CacheDir = '/tmp/shobocal'; +if (! -e $CacheDir) { + mkdir $CacheDir or die "cannot create $CacheDir: $!"; +} +my $cache = sprintf("%s/%s.xml", $CacheDir, Digest::MD5::md5_hex($uri)); +LWP::Simple::mirror($uri, $cache) or die "cannot get content from $uri"; +open(SHOBO, "<$cache"); +my (@line) = ; +close(SHOBO); +#my ($content) = get("$uri"); +#if ($content eq ""){ +#&writelog("getxml2db no responce from $uri, exit:"); +# exit;#しょぼかるが落ちているなど +#} +#my (@line) = split(/\n/, $content); foreach(@line){