1. Skip to navigation
  2. Skip to content

The ELC Community Blog

A knowledge exchange on Ruby on Rails and Agile Development

February 15, 2008

by Ariel H. Pillet

USPS Package Tracking


ELC Plugins

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.

February 06, 2008

by Emmanuel

Setting up rmagick on Ubuntu

I wanted to update rmagick to the latest version of the gem, so I ran

sudo gem install rmagick

The version that was going to be installed was 2.1.0, and it needed ImageMagick lib 6.3.x.

I went ahead and downloaded 6.3.8 from ImageMagick site (couldn’t use apt-get this time, latest version on repositories I found was 6.2.4.5). I had a previous version of ImageMagick laying on my system. So I ran:

sudo apt-get remove imagemagick 

tar xvvzf ImageMagick.tar.gz 

cd ImageMagick 

./configure –prefix=/usr 

make 

sudo make install 

sudo gem install rmagick 

sudo gem install rmagick -v 1.15.12 // if you want rmagick v1 installed. 

That’s all!

Source Thread


home | services | Ruby on Rails Development | code | blog | company