Skip to content

Latest commit

 

History

History
77 lines (62 loc) · 1.8 KB

README.rdoc

File metadata and controls

77 lines (62 loc) · 1.8 KB

Shipindo

Description

Library that scrapes rates from various Indonesian shipping carriers web 1.0 sites. API is similar in those of ActiveShipping.

Supported Shipping Carriers

Installation

gem install shipindo

Usage

  # use them all
  require 'shipindo'

  Shipindo.find_rates(
      :origin       => "MEDAN",
      :destination  => "TANGERANG",
      :weight       => 2)

  => {
            :origin => "MEDAN",
       :destination => "TANGERANG",
            :weight => 2,
           :carrier => "jne",
       :origin_code => "TUVTMTAwMDBK",
  :destination_code => "VEdSMTAwMDBK",
              :from => "MEDAN",
                :to => "TANGERANG",
          :response => {
            :rates => [
          [0] {
              :service_name => "SS",
              :service_type => "Dokumen/Paket",
                      :rate => 330000.0
          },
          [1] {
              :service_name => "YES",
              :service_type => "Dokumen/Paket",
                      :rate => 39000.0
          },
          [2] {
              :service_name => "REG",
              :service_type => "Dokumen/Paket",
                      :rate => 32000.0
          },
          [3] {
              :service_name => "OKE",
              :service_type => "Dokumen/Paket",
                      :rate => 30000.0
          }
      ],
           :origin => "MEDAN",
      :destination => "TANGERANG",
           :weight => "2"
  }
}

  # or only a single carrier
  require 'shipindo/carriers/jne'

  jne = Shipindo::Carrier::Jne.new
  jne.find_rates(
    :origin      => "JAKARTA",
    :destination => "MEDAN",
    :weight      => 2)

See MIT-LICENSE for details.