| 1 | package Catalyst::Plugin::Geocoding; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use LWP::Simple; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | our $VERSION = '0.01'; | |
| 7 | |||
| 8 | 0 | ▶ | sub geocoding { |
|
Subroutine
geocoding: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 9 | 0 | my $c = shift; | |
| 10 | 0 | my $location = shift; | |
| 11 | |||
| 12 | my $url = "http://maps.google.com/maps/geo?q=$location&output=csv&key=" | ||
| 13 | 0 | . $c->config->{gmap_key}; | |
| 14 | 0 | my $result = get($url); | |
| 15 | 0 | $result =~ m[(\d+),(\d+),(.+?),(.+)\z]o; | |
| 16 | 0 | return ($result, $1, $2, $3, $4); | |
| 17 | } | ||
| 18 | |||
| 19 | 1 | 1; | |
| 20 | |||
| 21 | __END__ | ||