download stock quote from yahoo

Discussion in 'Java' started by f, Feb 18, 2004.

  1. f

    f Guest

    I am writing an app in which I need to get the stock quote from Yahoo.
    Idealy, I will get a stream from Yahoo's web site and parse that as
    string and display the information (price, PE, volumn...).

    What class should I use?

    If you use "http://finance.yahoo.com/d/quotes.csv?s=YHOO&f=sl1d1t1c1ohgv&e=.csv"
    as URL in HttpConnection, you will download a file. How can I obtain a
    stream? Is there other URL in Yahoo's site I can get a stream?

    Thanks,

    ff
     
    f, Feb 18, 2004
    #1
    1. Advertising

  2. f wrote:
    > I am writing an app in which I need to get the stock quote from Yahoo.
    > Idealy, I will get a stream from Yahoo's web site and parse that as
    > string and display the information (price, PE, volumn...).
    >
    > What class should I use?
    >
    > If you use
    > "http://finance.yahoo.com/d/quotes.csv?s=YHOO&f=sl1d1t1c1ohgv&e=.csv"
    > as URL in HttpConnection, you will download a file. How can I obtain
    > a
    > stream? Is there other URL in Yahoo's site I can get a stream?
    >
    > Thanks,
    >
    > ff
     
    Andrew Thompson, Feb 18, 2004
    #2
    1. Advertising

  3. ...hmm. Let's try that again, with some text this time.

    Andrew Thompson wrote:
    > f wrote:
    >> I am writing an app in which I need to get the stock quote from
    >> Yahoo.


    Good for you. I am reading a group for
    c.l.j.programmer's, where folks are
    supposed to already know how to consult
    the JavaDocs.

    Your message indicates that you have not,
    and possibly are unaware of their existence.

    Please confine your posts to c.l.j.help
    for the moment, at least unitl you can
    figure how to use the JavaDocs and
    ask smart questions on usenet.

    --
    Andrew Thompson
    * http://www.PhySci.org/ Open-source software suite
    * http://www.PhySci.org/codes/ Web & IT Help
    * http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Feb 18, 2004
    #3
  4. After that reply you are probably thinking "does everyone in this
    newsgroup have a stick up their ****?" The answer is 'no'.

    Andrew Thompson, if you can't or don't want to help then just don't
    reply to the post, there's no need to bite people's heads off.

    f. To answer your question. Try adapting the following code for your
    application:

    // Read an http resource in to a stream
    String tAddress = "http://domain/path/to/resource/file.ext";
    URL tDocument = new URL(tAddress);
    URLConnection tConnection = tDocument.openConnection();
    tConnection.connect();
    BufferedReader tBufferedReader = new BufferedReader
    (new InputStreamReader(tDocument.openStream()));

    then read the stream as you would with any other BufferedReader object
    (keyboard input, for example).

    Hope this is a bit more helpful than Andrew's reply.

    Andrew Thompson wrote:
    > ..hmm. Let's try that again, with some text this time.
    >
    > Andrew Thompson wrote:
    >
    >>f wrote:
    >>
    >>>I am writing an app in which I need to get the stock quote from
    >>>Yahoo.

    >
    >
    > Good for you. I am reading a group for
    > c.l.j.programmer's, where folks are
    > supposed to already know how to consult
    > the JavaDocs.
    >
    > Your message indicates that you have not,
    > and possibly are unaware of their existence.
    >
    > Please confine your posts to c.l.j.help
    > for the moment, at least unitl you can
    > figure how to use the JavaDocs and
    > ask smart questions on usenet.
    >
    > --
    > Andrew Thompson
    > * http://www.PhySci.org/ Open-source software suite
    > * http://www.PhySci.org/codes/ Web & IT Help
    > * http://www.1point1C.org/ Science & Technology
    >
    >
     
    Peter Astbury, Feb 18, 2004
    #4
  5. f

    Berlin Brown Guest

    f wrote:
    > I am writing an app in which I need to get the stock quote from Yahoo.
    > Idealy, I will get a stream from Yahoo's web site and parse that as
    > string and display the information (price, PE, volumn...).
    >
    > What class should I use?
    >
    > If you use "http://finance.yahoo.com/d/quotes.csv?s=YHOO&f=sl1d1t1c1ohgv&e=.csv"
    > as URL in HttpConnection, you will download a file. How can I obtain a
    > stream? Is there other URL in Yahoo's site I can get a stream?
    >
    > Thanks,
    >
    > ff


    I haven't looked at the yahoo finance page, but I am sure they have a
    rss or XML tag somewhere and you can get the quote. I dont much trust
    csv or plain text. (that is just me)
     
    Berlin Brown, Feb 19, 2004
    #5
  6. f

    Berlin Brown Guest

    Peter Astbury wrote:
    > After that reply you are probably thinking "does everyone in this
    > newsgroup have a stick up their ****?" The answer is 'no'.
    >
    > Andrew Thompson, if you can't or don't want to help then just don't
    > reply to the post, there's no need to bite people's heads off.
    >
    > f. To answer your question. Try adapting the following code for your
    > application:
    >
    > // Read an http resource in to a stream
    > String tAddress = "http://domain/path/to/resource/file.ext";
    > URL tDocument = new URL(tAddress);
    > URLConnection tConnection = tDocument.openConnection();
    > tConnection.connect();
    > BufferedReader tBufferedReader = new BufferedReader
    > (new InputStreamReader(tDocument.openStream()));
    >
    > then read the stream as you would with any other BufferedReader object
    > (keyboard input, for example).
    >
    > Hope this is a bit more helpful than Andrew's reply.
    >
    > Andrew Thompson wrote:
    >
    >> ..hmm. Let's try that again, with some text this time.
    >>
    >> Andrew Thompson wrote:
    >>
    >>> f wrote:
    >>>
    >>>> I am writing an app in which I need to get the stock quote from
    >>>> Yahoo.

    >>
    >>
    >>
    >> Good for you. I am reading a group for
    >> c.l.j.programmer's, where folks are
    >> supposed to already know how to consult
    >> the JavaDocs.
    >>
    >> Your message indicates that you have not,
    >> and possibly are unaware of their existence.
    >>
    >> Please confine your posts to c.l.j.help
    >> for the moment, at least unitl you can
    >> figure how to use the JavaDocs and
    >> ask smart questions on usenet.
    >>
    >> --
    >> Andrew Thompson
    >> * http://www.PhySci.org/ Open-source software suite
    >> * http://www.PhySci.org/codes/ Web & IT Help
    >> * http://www.1point1C.org/ Science & Technology
    >>
    >>

    Personally I like the comments, I think they are real and I learn more
    if people are direct and to the point as opposed to wishy-washy. We are
    programmer, we have thick skins.
     
    Berlin Brown, Feb 19, 2004
    #6
  7. f

    f Guest

    You are sick and **** you JavaDocs.


    "Andrew Thompson" <> wrote in message news:<xGPYb.65461$>...
    > ..hmm. Let's try that again, with some text this time.
    >
    > Andrew Thompson wrote:
    > > f wrote:
    > >> I am writing an app in which I need to get the stock quote from
    > >> Yahoo.

    >
    > Good for you. I am reading a group for
    > c.l.j.programmer's, where folks are
    > supposed to already know how to consult
    > the JavaDocs.
    >
    > Your message indicates that you have not,
    > and possibly are unaware of their existence.
    >
    > Please confine your posts to c.l.j.help
    > for the moment, at least unitl you can
    > figure how to use the JavaDocs and
    > ask smart questions on usenet.
     
    f, Feb 19, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    443
    Roland
    Jan 24, 2005
  2. plato399
    Replies:
    1
    Views:
    383
    Tim Anderson
    Apr 16, 2004
  3. savvy
    Replies:
    1
    Views:
    509
    Cowboy \(Gregory A. Beamer\)
    Jun 28, 2006
  4. Lorn
    Replies:
    1
    Views:
    369
    Artie Gold
    Dec 8, 2005
  5. parvathi
    Replies:
    0
    Views:
    448
    parvathi
    Feb 3, 2009
Loading...

Share This Page