Skip to content

Instantly share code, notes, and snippets.

@jacoyutorius
Created October 29, 2012 03:49
Show Gist options
  • Save jacoyutorius/3971405 to your computer and use it in GitHub Desktop.
Save jacoyutorius/3971405 to your computer and use it in GitHub Desktop.
using GeocodingAPI
#encoding: utf-8
require "rubygems"
require "open-uri"
require "json"
require "active_support/core_ext"
require "pp"
print "Content-Type:text/html\r\n\r\n"
address = "hamamatsu"
uri = "http://www.geocoding.jp/api/?v=1.1&q=#{address}"
result = open(uri , "r:UTF-8")
json = Hash.from_xml(result).to_json
pp json
pp json["lat"]
JSON.load(json)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment