Project

ziptastic

0.01
No commit activity in last 3 years
No release in over 3 years
Ruby port of Thomas Schultz's Ziptastic API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.9.0

Runtime

 Project Readme

Ziptastic Ruby

A simple Ruby port of Thomas Schultz's Ziptastic zip code API.

Installation

Add this line to your application's Gemfile:

gem 'ziptastic'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ziptastic

Usage

To search against the database locally:

require 'ziptastic'
results = Ziptastic.search("16335")
  # => [  {:city=>"MEADVILLE", :state=>"PA", :country=>"US"},
  #       {:city=>"BLOOMING VALLEY", :state=>"PA", :country=>"US"},
  #       {:city=>"KERRTOWN", :state=>"PA", :country=>"US"} ]

Local database searches often return multiple results for a single zip code.

Alternatively, an executable is also included that provides a search API via Sinatra:

$ ziptastic
$ curl http://localhost:5678?zip=16335
  # => {"city":"MEADVILLE","state":"PA","country":"US"}

The web API is compatible with the example JS script provided by Thomas Schultz. You'll just need to update the client URL.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request