No release in over 3 years
Low commit activity in last 3 years
A Rack app that responds to queries containing a country code with appropriate subdivision data as JSON.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 0
>= 0
 Project Readme

Subdivision Responder

A simple Rack app that responds with subdivisions (states and provinces) when queried with an alpha2 country code.

% curl http://example.com/subdivisions\?country_code\=US
{"US":[["Alaska","AK"],["Alabama","AL"],...]}

Installation for use in a Rails app

In your Gemfile:

gem 'subdivision_responder'

In your config/routes.rb:

mount SubdivisionResponder::RackApp.new => '/subdivisions'

Data

All country and subdivision data is sourced from the countries gem

Copyright

MIT Licensed

Copyright (c) 2013 Michael Klett / Chargify

See LICENSE.txt for further details.