--- currency_api/currency_api.module	2007-04-10 05:19:27.000000000 +0200
+++ currency_api/currency_api.module 2007-09-17 18:20:24.000000000 +0200
@@ -97,7 +97,8 @@ function currency_api_convert($currency_
   $from = strtoupper($currency_from);
   $to   = strtoupper($currency_to);
 
-  $url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f='. currency_api_get_fields($currency_array) .'&s='. $from . $to .'=X';
+  $url = 'http://download.finance.yahoo.com/d/quotes.csv?e=.csv&f='. currency_api_get_fields($currency_array) .'&s='. $from . $to .'=X';
+
 
   // Validate the passed currency codes, to make sure they are valid
   if (FALSE == currency_api_get_desc($from)) {
@@ -123,7 +124,17 @@ function currency_api_convert($currency_
   }
 
   
-  $record = file_get_contents($url);
+  if (($ch = @curl_init())) {
+    $timeout = 5; // set to zero for no timeout
+    curl_setopt ($ch, CURLOPT_URL, "$url");
+    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
+    $record = curl_exec($ch);
+    curl_close($ch);
+  } else {
+    $record = file_get_contents($url);
+  }
+
   if ($record) {
     $currency_data = explode(',', $record);
     $rate = $currency_data[1];
