I had to ad some slight modification to the currency module in order to access remotely yahoo finance using the following code and the application was working gracefully. I needed to use curl because my host does not allow direct remote file access.
However when I check it today it does not give exchange value. It just gives zero. The website where the application is running is: currency exchange
//$record = file_get_contents($url);
$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);
//$file_contents = curl_exec($ch);
$record = curl_exec($ch);
curl_close($ch);
// display file
//echo $file_contents;
Comments
Comment #1
wisdom commentedPlease refer this link Currency Exchange The above link does not take to the page.
Comment #2
wisdom commentedchanging the url
makes it work.
Comment #3
(not verified) commented