February 15, 2008
keli wrote:
it looks nice to me, however, does it only track the current position, or all...
Ariel H. Pillet wrote:
Sorry, I’ve fixed that. Try again now. :)
USPS Package Tracking
About
USPS Track is a plugin which allows you to track US Postal Service packages easily from your Rails app.
Installation
To get started, install it with the following command:
script/plugin install http://svn.elctech.com/svn/public/plugins/usps_track
Second, you'll need a USPS developer account:. You can register here
Usage
Initialize the class with your USPS username:
usps = ELC::USPS.new(username)
Track a package:
result = usps.track(tracking_number)
It returns an array of hashes with the following structure:
{ :eventstate => "DE",
:event => "NOTICE LEFT",
:eventzipcode => "19801",
:eventtime => "11:07 am",
:eventdate => "May 30, 2001",
:eventcity => "WILMINGTON" }
It's that simple! Please respond with any suggestions, comments or corrections.