Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

UPS Shipping rates

by mpolo (Chaplain)
on Jan 05, 2004 at 17:49 UTC ( [id://318897]=perlquestion: print w/replies, xml ) Need Help??

mpolo has asked for the wisdom of the Perl Monks concerning the following question:

I'm looking for an "easy" solution to getting UPS shipping rates realtime. There are two CPAN modules for this. Business::UPS uses the 2000 tables, which are no longer accurate or updated, and which do not allow shipping from a country other than the US or Puerto Rico.

Business::Shipping looks more promising, but has about 50 dependency modules, and since I have to use LWP through a proxy, I'd have to get in and understand it anyway.

I presume that for the simple rate lookup that I want (always shipping from one location, to various locations), there should be an easier way than the dependency installation route (which has already wasted hours of my time, since each dependency needs another, and so on, and I haven't got the CPAN module working with this proxy -- also many of the modules require a later version of Perl than I have on this server, so I have to massage the source a bit to get them to install.). Has anyone seen simple code to access the XML rate feed? If not, I guess I'll have to reinvent the wheel...

Replies are listed 'Best First'.
Re: UPS Shipping rates
by Art_XIV (Hermit) on Jan 05, 2004 at 18:51 UTC

    Have you checked out any of UPS's tools? You'll have to register to access them.

    I don't know if they have anything that would help, but it probably won't hurt to check it out.

    Hanlon's Razor - "Never attribute to malice that which can be adequately explained by stupidity"
      UPS's tools consists of a big PDF file explaining their API. The organization of the PDF is a bit off-putting and confusing, but I think there is probably enough information there to get the thing working. (I think there may be some C++ or Visual Basic code hidden there somewhere as well, but no Perl...) That's what I meant about re-inventing the wheel... If someone's already done this, I'd just assume use their work, but if not, I'll just have to dig in.
Re: UPS Shipping rates
by graff (Chancellor) on Jan 06, 2004 at 07:24 UTC
    This is outside my realm because I've never tried it, but from what I understand about WWW::Mechanize, this might be the sort of task it would be good at. (I'm not sure what dependencies it might have on other modules.) You'd need to inspect the source html of the UPS pages involved, in order to determine the names of the input parameters you need to set, etc.

      Unfortunately, UPS seems to change their interactive web interface too often to make this practical. I had a working solution using LWP::UserAgent and then parsing the HTML that came back, but a month later they modified the system to pass back more information in another format...

      Supposedly, the XML feed is the "correct" way to automatically get rate info from them.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://318897]
Approved by Paladin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-18 22:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found