Postie is a Sinatra based rack middleware that can be dropped into any rack or rails application. Postie provides Auspost (Australia Post) postcode information via a json interface.
It's a bit rough but it works. Patches are welcome.
Sinatra or Rack applications
require 'postie' use Postie::Application
require File.join(File.dirname(__FILE__), 'boot') Rails::Initializer.run do |config| config.gem 'postie', :lib => 'postie' config.middleware.use 'Postie::Application' end
Drop in postie then navigate to
/postcode for full API reference.
/postcode/statesLists the states available
/postcode/state/:nameLists the postcodes available for each state
/postcode/suburbsLists the suburbs available
/postcode/suburb/:nameReturns the postcode information for said suburb
- Pat Allan, I stole his postie idea that was originally a Rails app, then a Merb app. I took one more progression and made it even smaller (Sinatra / Rack)
- Ben Askins, for the db:import / FasterCSV task
Copyright (c) 2009 Ben Schwarz. See LICENSE for details.