in reply to UPS Online over HTTPS

It can be done and I've actually done it. What I did was to download the rate pages and then parsed them to get the pertinant information out.

This may not be the greatest code as I wrote it a while ago, but see if this helps.

#!/usr/bin/perl use strict; my $resfile = 'ground.txt'; my $comfile = 'grndcomm.txt'; my $zonefile='delzone.txt'; my @res; my @com; my @zone; &buildrates; &buildzones; sub buildrates{ my $line; open FH, $resfile; while ($line = <FH>){ my ($index, $z2, $z3, $z4, $z5, $z6, $z7, $z8)= split(',',$line); $res[$index]= [$z2,$z3,$z4,$z5,$z6,$z7,$z8]; } close FH; open FH, $comfile; while ($line = <FH>){ my ($index, $z2, $z3, $z4, $z5, $z6, $z7, $z8)= split(',',$line); $res[$index]= [$z2,$z3,$z4,$z5,$z6,$z7,$z8]; } close FH; } sub buildzones{ my ($x, $y, $line); my $i=0; open FH, $zonefile; while ($line = <FH>){ ($x,$y) = split(',',$line); if (length($x)<=3){ $zone[$x]=$y } else{ (my $temp, $x) = split('-',$x); for ($temp..$x){ $zone[$_]= $y; } } } }

When I wrote this, I just grabbed the files off the UPS website. I believe that they were available in a plain text format, but it's been a while so I don't remember for sure.

Hopefully this will help in some way. :)

There is no emoticon for what I'm feeling now.

Replies are listed 'Best First'.
Re: Re: UPS Online over HTTPS
by ajdelore (Pilgrim) on Jul 17, 2003 at 17:16 UTC

    If the files were on the website, you could always add code to have LWP::Useragent go and get them. I can't imagine that those files would be stashed on the secure server.

    </ajdelore>

      You're right. I realized after I thought about it a bit that the poster was asking about doing that over a secure server, but what I did should work.

      I wrote that code about a year ago and hadn't discovered the LWP library at the time. Using LWP and mirroring to check for newer versions would probably be the way to go. And the LWP suggestion is going to get implemented as soon as I get a bit of free time. Thanks for that!

      There is no emoticon for what I'm feeling now.