From 0943a6243e322acf4a9f116830046a1bb62b7db1 Mon Sep 17 00:00:00 2001 From: EGEMEN Date: Thu, 8 Oct 2015 18:39:54 +0700 Subject: [PATCH] URL update appspot's api url update --- classes/convert.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 +}