Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ferreira (5993)

  (email not shown publicly)

Just another Brazilian Perl hacker.

Journal of ferreira (5993)

Tuesday June 13, 2006
11:55 AM

Geo::Coder::Google behind a Squid proxy

[ #29891 ]
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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.