i'm having trouble grabbing multiple currencies @ once yahoo, code produces first request not second.
public double getrate(string from1, string to1, string from2, string to2) { try { url url = new url("http://quote.yahoo.com/d/quotes.csv?f=l1&s=" + from1 + to1 + "=x," + from2 + to2 + "=x"); bufferedreader reader = new bufferedreader(new inputstreamreader(url.openstream())); string line = reader.readline(); if (line.length() > 0) { return double.parsedouble(line); } reader.close(); } catch (ioexception | numberformatexception e) { system.out.println(e.getmessage()); } return 0; } any thoughts appreciated.
best
Comments
Post a Comment