#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use YAML;
use WebService::Simple;
my $key = 'hoge';
my $service = WebService::Simple->new(
base_url => 'http://maps.google.com/maps/',
param => {
key => $key,
output => 'xml',
},
);
my $res = $service->get('geo', {q => '東京都千代田区千代田1-1'})->parse_response;
warn Dump $res;
↓こうなった。
- Response:
Placemark:
AddressDetails:
Accuracy: 8
Country:
AdministrativeArea:
AdministrativeAreaName: Tokyo
Locality:
DependentLocality:
DependentLocalityName: 千代田
Thoroughfare:
ThoroughfareName: 1−1
LocalityName: 千代田区
CountryName: Japan
CountryNameCode: JP
xmlns: urn:oasis:names:tc:ciq:xsdschema:xAL:2.0
ExtendedData:
LatLonBox:
east: 139.7571208
north: 35.6869988
south: 35.6807036
west: 139.7508256
Point:
coordinates: '139.7539732,35.6838512,0'
address: '1 1千代田, 千代田区Tokyo, Japan'
id: p1
Status:
code: 200
request: geocode
name: 東京都千代田区千代田1-1
xmlns: http://earth.google.com/kml/2.0
あれ。api keyいらんのかな。