aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode.pm
diff options
context:
space:
mode:
authorEdmund von der Burg <evdb@mysociety.org>2011-02-07 16:05:46 +0000
committerEdmund von der Burg <evdb@mysociety.org>2011-02-07 16:05:46 +0000
commitf9ff759862986ac784ac7090ed3181b152e1f52d (patch)
tree0fa53b01f2df758c35f7659356044c443078188d /perllib/FixMyStreet/Geocode.pm
parentf87390b2dd4dd1b57f122426b23a1080c1e86c93 (diff)
Add note about cache dir to install steps
Create geo cache dir if it is missing
Diffstat (limited to 'perllib/FixMyStreet/Geocode.pm')
-rw-r--r--perllib/FixMyStreet/Geocode.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 9e89b4f7b..4854411cf 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -11,6 +11,7 @@ package FixMyStreet::Geocode;
use strict;
use Error qw(:try);
use File::Slurp;
+use File::Path ();
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
use URI::Escape;
@@ -96,6 +97,7 @@ sub string {
$url .= ',+UK' unless $url =~ /united\++kingdom$/ || $url =~ /uk$/i;
$url .= '&sensor=false&gl=uk&key=' . mySociety::Config::get('GOOGLE_MAPS_API_KEY');
$js = LWP::Simple::get($url);
+ File::Path::mkpath($cache_dir);
File::Slurp::write_file($cache_file, $js) if $js && $js !~ /"code":6[12]0/;
}
if (!$js) {