Code Monkey home page Code Monkey logo

postie's Introduction

postie

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.

Drop it into your application and happily use your favourite javascript library to work out what the postcode for the suburb your user just typed in.

Code quality

It's a bit rough but it works. Patches are welcome.

Sinatra or Rack applications

require 'postie'
use Postie::Application

Rails applications

require File.join(File.dirname(__FILE__), 'boot')

Rails::Initializer.run do |config|
  config.gem 'postie', :lib => 'postie'

  config.middleware.use 'Postie::Application'
end

API

Drop in postie then navigate to /postcode for full API reference.

  • /postcode/states Lists the states available
  • /postcode/state/:name Lists the postcodes available for each state
  • /postcode/suburbs Lists the suburbs available
  • /postcode/suburb/:name Returns the postcode information for said suburb

Data source

Postie data comes from Auspost, I haven't even read the terms of use, thats just how thug I am. The database dump is dated 28/04/09

Thanks

  • 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

Copyright (c) 2009 Ben Schwarz. See LICENSE for details.

postie's People

Contributors

benschwarz avatar

Stargazers

David Turnbull avatar  avatar

Watchers

David Turnbull avatar James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.