Geo::Coder::Google behind a Squid proxy

ferreira on 2006-06-13T16:55:02

I tried Geo::Coder::Google today, which is a Perl interface to Google Maps API. It is not so exciting to me because Google Maps only has very rough information about Brazil. The module works: I had to check the source to write code to get through the Squid proxy (an authenticating proxy) here at work. It goes like this:

use Geo::Coder::Google;
use LWP::UserAgent;

my $ua = LWP::UserAgent->new(agent => "Geo::Coder::Google/0.01"); $ua->proxy('http', 'http://user:pass@proxy.domain:999'); my $geocoder = Geo::Coder::Google->new(apikey => $GOOGLE_MAPS_APIKEY, ua => $ua);


and everything else (where everything else is the method "geocode") follows the documentation.