| 57 | | my ($content) = get("$uri"); |
|---|
| 58 | | if ($content eq ""){ |
|---|
| 59 | | &writelog("getxml2db no responce from $uri, exit:"); |
|---|
| 60 | | exit;#しょぼかるが落ちているなど |
|---|
| 61 | | } |
|---|
| 62 | | |
|---|
| 63 | | my (@line) = split(/\n/, $content); |
|---|
| | 58 | # If-Modified-Since使うように変更#2008/11/14 |
|---|
| | 59 | my $CacheDir = '/tmp/shobocal'; |
|---|
| | 60 | if (! -e $CacheDir) { |
|---|
| | 61 | mkdir $CacheDir or die "cannot create $CacheDir: $!"; |
|---|
| | 62 | } |
|---|
| | 63 | my $cache = sprintf("%s/%s.xml", $CacheDir, Digest::MD5::md5_hex($uri)); |
|---|
| | 64 | LWP::Simple::mirror($uri, $cache) or die "cannot get content from $uri"; |
|---|
| | 65 | open(SHOBO, "<$cache"); |
|---|
| | 66 | my (@line) = <SHOBO>; |
|---|
| | 67 | close(SHOBO); |
|---|
| | 68 | #my ($content) = get("$uri"); |
|---|
| | 69 | #if ($content eq ""){ |
|---|
| | 70 | #&writelog("getxml2db no responce from $uri, exit:"); |
|---|
| | 71 | # exit;#しょぼかるが落ちているなど |
|---|
| | 72 | #} |
|---|
| | 73 | #my (@line) = split(/\n/, $content); |
|---|