Index: /trunk/doc/CHANGES.txt =================================================================== --- /trunk/doc/CHANGES.txt (リビジョン 79) +++ /trunk/doc/CHANGES.txt (リビジョン 82) @@ -1,3 +1,7 @@ foltia 更新履歴 http://www.dcc-jpl.com/soft/foltia/ + +08.11.15 +getxml2db.pl: +If-Modified-Sinceの条件付きGETに対応。 08.6.27 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){