Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help!!!!To pull exchange rates from yahoo, based on CNET JSP tutorial

843833Jun 19 2001 — edited Jun 20 2001
The URL,

http://builder.cnet.com/webbuilding/pages/Programming/JSP/ss05.html

has a JSp example, to get quotes from yahoo page.
private void getSymbolValue(String symbol) {
    String urlString = 
    "http://quote.yahoo.com/download/javasoft.beans?SYMBOLS=" +
    symbol + "&format=nl";
  try {
    URL url = new URL(urlString);
    URLConnection con = url.openConnection();
    InputStream is = con.getInputStream();
    InputStreamReader isr = new InputStreamReader(is);
    BufferedReader br = new BufferedReader(isr);
    String line = br.readLine();
    StringTokenizer tokenizer = new StringTokenizer(line,",");
    name = tokenizer.nextToken();
    name = name.substring(1, name.length()-2); // remove quotes
    price = tokenizer.nextToken();
    price = price.substring(1, price.length()-2); // remove quotes
  } catch (IOException exception) {
    System.err.println("IOException: " + exception);
  }
How do I figure out the URL,


"http://quote.yahoo.com/download/javasoft.beans?SYMBOLS=" +
symbol + "&format=nl";

for the exchange rates page? There is no "/download/ etc. etc." path at the finance.yahoo.com page!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 18 2001
Added on Jun 19 2001
2 comments
98 views