gpt4 book ai didi

java - 雅虎货币转换器 API

转载 作者:行者123 更新时间:2023-11-29 04:24:27 27 4
gpt4 key购买 nike

<分区>

我一直在使用雅虎货币转换器,没有出现任何问题。

Java 中的函数代码如下:

 public static Float convert(String currencyFrom, String currencyTo) throws IOException {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet("http://quote.yahoo.com/d/quotes.csv?s=" + currencyFrom + currencyTo + "=X&f=l1&e=.csv");
ResponseHandler<String> responseHandler = new BasicResponseHandler();
String responseBody = httpclient.execute(httpGet, responseHandler);
httpclient.getConnectionManager().shutdown();
return Float.parseFloat(responseBody);

}

然而,就在昨天我意识到它抛出以下错误:

It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com.

我使用的代码有问题吗?或者服务是否已永久停止。对于实时货币转换还有其他建议吗?

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com