From e860d3c84bd732ea9fcaca4435af0f044db42507 Mon Sep 17 00:00:00 2001 From: Robert Staddon Date: Thu, 13 Jul 2017 14:19:52 -0500 Subject: [PATCH] Update URL to UPS XML Track API This script recently started throwing "302 Moved Permanently" errors in the isOnline() function which kept it from running. Looking into the latest UPS Developer Kit for the Tracking API (https://www.ups.com/upsdeveloperkit), we find that the correct URL is now https://onlinetools.ups.com/ups.app/xml/Track --- upsTrack.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upsTrack.php b/upsTrack.php index d3a051a..33dce87 100644 --- a/upsTrack.php +++ b/upsTrack.php @@ -32,7 +32,7 @@ function getTrack($trackingNumber) { if(!$this->isOnline()) throw new Exception("The UPS service seems to be down with HTTP/1.1 $value"); - $ch = curl_init("https://www.ups.com/ups.app/xml/Track"); + $ch = curl_init("https://onlinetools.ups.com/ups.app/xml/Track"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch,CURLOPT_POST,1); curl_setopt($ch,CURLOPT_TIMEOUT, 15); @@ -99,7 +99,7 @@ function getXML($trackingNumber) { function isOnline() { - $ch = curl_init("https://www.ups.com/ups.app/xml/Track"); + $ch = curl_init("https://onlinetools.ups.com/ups.app/xml/Track"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch,CURLOPT_TIMEOUT, 15); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);