diff --git a/classes/convert.php b/classes/convert.php index eaff428..efc4689 100644 --- a/classes/convert.php +++ b/classes/convert.php @@ -108,14 +108,14 @@ public function convert($amount, $from, $to, $round = TRUE) protected function fetch($amount, $from, $to) { - $url = "http://rate-exchange.appspot.com/currency?q={$amount}&from={$from}&to={$to}"; + $url = "https://currency-api.appspot.com/api/{$from}/{$to}.json?amount={$amount}"; $amount = (float) $amount; if (in_array('curl', get_loaded_extensions())) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_URL, "http://rate-exchange.appspot.com/currency?q={$amount}&from={$from}&to={$to}"); + curl_setopt($ch, CURLOPT_URL, "https://currency-api.appspot.com/api/{$from}/{$to}.json?amount={$amount}"); $response = json_decode(curl_exec($ch), true); } @@ -245,4 +245,4 @@ protected function newCache($file, $rate) } -} \ No newline at end of file +}