$data = file_get_contents('http://jsonrates.com/get/?from=USD&to=EUR');
$json = json_decode($data);
$rate = (float) $json->rate;
import org.apache.commons.io.IOUtils;
import org.json.JSONObject;
import java.net.URL;
URL url = new URL("http://jsonrates.com/get/?from=USD&to=EUR");
String data = IOUtils.toString(url);
JSONObject json = new JSONObject(data);
Double rate = json.getDouble("rate");
require 'open-uri'
require 'json'
stream = open("http://jsonrates.com/get/?from=USD&to=EUR")
data = stream.read
json = JSON.parse(data)
rate = json["rate"].to_f