--- a/tripPlanner.php +++ b/tripPlanner.php @@ -167,7 +167,11 @@ trackEvent("Trip Planner", "Plan Trip To", $to); $tripplan = json_decode($page); debug(print_r($tripplan, true)); + if (isset ($tripplan->error->msg)) { + echo $tripplan->error->msg; + } else { echo "

From: {$tripplan->plan->from->name} To: {$tripplan->plan->to->name}

"; + echo $tripplan->plan->date; echo "

At: " . formatTime($tripplan->plan->date) . "

"; if (is_array($tripplan->plan->itineraries->itinerary)) { echo '
'; @@ -177,6 +181,7 @@ echo "
"; } else { processItinerary(0, $tripplan->plan->itineraries->itinerary); + } } } curl_close($ch);