URL::Signature::Google::Maps::API - Sign URLs for use with Google Maps API Enterprise Business Accounts
use URL::Signature::Google::Maps::API; my $signer = URL::Signature::Google::Maps::API->new(); my $server = "http://maps.googleapis.com"; my $path_query = "/maps/api/staticmap?size=600x300&markers=Clifton,VA&sensor=false"; my $url = $signer->url($server => $path_query);
Generates a signed URL for use in the Google Maps API. The Google Enterprise keys can be stored in an INI file (i.e. /etc/google.conf) or passed on assignment..
Use client and key from INI file /etc/google.conf
my $signer=URL::Signature::Google::Maps::API->new(channel => "myapp");
Use client and key from construction
my $signer=URL::Signature::Google::Maps::API->new( client => "abc-xyzpdq", key => "xUUUUUUUUUUUU-UUUUUUUUUUUUU=", channel => "myapp", );
Don't use client or signature just pass through URLs
my $signer=URL::Signature::Google::Maps::API->new(client=>"");
Returns a signed URL given a two part URL of server and path_query.
my $url=$signer->url($server => $path_query);
Example
my $url=$signer->url("http://maps.googleapis.com" => "/maps/api/staticmap?size=600x300&markers=Clifton,VA&sensor=false");
This method adds client and channel parameters (if configured) so they should not be added to the passed in path query.
Returns the signature value if you want to use the mathematics without the url method.
my $path_query = "/path/script" . "?" . $query; my $url=$protocol_$server . $path_query . "&signature=" . $signer->signature($path_query);
You may store the credentials in an INI formatted file or you may specify the credentials on construction or after construction.
Configuration file format
[GoogleAPI] client=abc-xyzpdq key=xUUUUUUUUUUUU-UUUUUUUUUUUUU=
Sets and returns the Google Enterprise Client
Default: Value from INI file $signer->client("abc-xyzpdq");
Sets and returns the Google Enterprise Key
Default: Value from INI file $signer->key("xUUUUUUUUUUUU-UUUUUUUUUUUUU=");
Sets and returns the Google Enterprise channel for determining application in Google Enterprise Support Portal (http://www.google.com/enterprise/portal).
Default: ""
Note: This is a per application setting not a per user setting.
Sets and returns the filename of the configuration file.
Default: /etc/google.conf
Sets and returns a list of Path::Class:Dir objects to check for a readable basename.
Precedence: sysconfdir (i.e. /etc), Perl script directory, then current directory (i.e. ".") Default: [/etc, $0->dir, .]
Sets and returns the basename for the Google configuration file.
Default: google.conf
Please log on RT and send an email to the author.
DavisNetworks.com supports all Perl applications including this package.
Michael R. Davis CPAN ID: MRDVT Satellite Tracking of People, LLC mdavis@stopllc.com http://www.stopllc.com/
This program is free software licensed under the...
The General Public License (GPL) Version 2, June 1991
The full text of the license can be found in the LICENSE file included with this module.
http://gmaps-samples.googlecode.com/svn/trunk/urlsigning/index.html, http://gmaps-samples.googlecode.com/svn/trunk/urlsigning/urlsigner.pl, Geo::Coder::Google::V3
To install URL::Signature::Google::Maps::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URL::Signature::Google::Maps::API
CPAN shell
perl -MCPAN -e shell install URL::Signature::Google::Maps::API
For more information on module installation, please visit the detailed CPAN module installation guide.