我一直在寻找Fedex和UPS的Ruby实现。
我一直在阅读他们的文档,并认为它真的过于复杂(我自己有点像红宝石“新手”),所以一直在寻找更简单的东西。我只想使用跟踪功能。
有没有人曾经做过类似的事情并且能指出我如何实现这个目标的正确方向?
答案 0 :(得分:3)
试用Shopify's active_shipping插件。它支持UPS,USPS和FedEx。开发人员正在计划添加跟踪支持(根据自述文件),但已经为FedEx跟踪提供了支持:
fdx = FedEx.new(:login => '999999999', :password => '7777777')
tracking_info = fdx.find_tracking_info('tracking number here', :carrier_code => 'fedex_ground') # Ground package
tracking_info.shipment_events.each do |event|
puts "#{event.name} at #{event.location.city}, #{event.location.state} on #{event.time}. #{event.message}"
end
# => Package information transmitted to FedEx at NASHVILLE LOCAL, TN on Thu Oct 23 00:00:00 UTC 2008.
# Picked up by FedEx at NASHVILLE LOCAL, TN on Thu Oct 23 17:30:00 UTC 2008.
# Scanned at FedEx sort facility at NASHVILLE, TN on Thu Oct 23 18:50:00 UTC 2008.
# Departed FedEx sort facility at NASHVILLE, TN on Thu Oct 23 22:33:00 UTC 2008.
# Arrived at FedEx sort facility at KNOXVILLE, TN on Fri Oct 24 02:45:00 UTC 2008.
# Scanned at FedEx sort facility at KNOXVILLE, TN on Fri Oct 24 05:56:00 UTC 2008.
# Delivered at Knoxville, TN on Fri Oct 24 16:45:00 UTC 2008. Signed for by: T.BAKER
答案 1 :(得分:2)
答案 2 :(得分:0)
另一个是shiprush api。 http://developer.shiprush.com