Index: openacs-4/packages/ecommerce/www/track.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/track.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/ecommerce/www/track.tcl 22 Jul 2001 07:10:03 -0000 1.2 +++ openacs-4/packages/ecommerce/www/track.tcl 23 Oct 2001 05:48:48 -0000 1.3 @@ -42,29 +42,29 @@ set carrier_info "" if { $carrier == "FedEx" } { - set fedex_url "http://www.fedex.com/cgi-bin/track_it?airbill_list=$tracking_number¤t_airbill=$tracking_number&language=english&cntry_code=us&state=0" + ### from Bart T. + set fedex_url "http://www.fedex.com/cgi-bin/tracking?tracknumbers=$tracking_number&action=track&language=english&cntry_code=us" with_catch errmsg { set page_from_fedex [ns_httpget $fedex_url] - regexp {(.*)} $page_from_fedex match carrier_info + ### from Bart T. + regexp {().*?(
.*?
)} $page_from_fedex match detailed_info scan_activity + set carrier_info "$detailed_info $scan_activity" } { set carrier_info "Unable to retrieve data from FedEx." } } elseif { [string match "UPS*" $carrier] } { - set ups_url "http://wwwapps.ups.com/etracking/tracking.cgi?submit=Track&InquiryNumber1=$tracking_number&TypeOfInquiryNumber=T" + ### from Bart T. + set ups_url "http://wwwapps.ups.com/etracking/tracking.cgi?submit=Track&InquiryNumber1=$tracking_number&TypeOfInquiryNumber=T&build_detail=yes" with_catch errmsg { - set first_ups_page [ns_httpget $ups_url] + ### from Bart T. + set ups_page [ns_httpget $ups_url] # UPS needs this magic line1 to get to the more interesting detail page. - if { ![regexp {NAME="line1" VALUE="([^\"]+)"} $first_ups_page match line1] } { - set carrier_info "Unable to parse summary information from UPS." + ### from Bart T. + if { ![regexp {(]*>Tracking Number:.*).*Tracking results provided by UPS} $ups_page match ups_info] } { + set carrier_info "Unable to parse detail data from UPS." } else { - set url "http://wwwapps.ups.com/etracking/tracking.cgi" - set formvars "InquiryNumber1=$tracking_number&TypeOfInquiryNumber=T&line1=[ns_urlencode $line1]&tdts1=1" - set second_ups_page [util_httppost $url $formvars] - if { ![regexp {(]*>Tracking Number:.*).*Tracking results provided by UPS} $second_ups_page match ups_info] } { - set carrier_info "Unable to parse detail data from UPS." - } else { - set carrier_info "$ups_info" - } + ### from Bart T. + set carrier_info "
$ups_info" } } { set carrier_info "Unable to retrieve data from UPS."