zzhang2006
asked on
Real time stock quote feed site
I am trying to write a Perl script to get the stock quotes. Only server I know now is the yahoo server, which has a twenty minutes delay. I would like to know how to connect NY exchange realtime servers or subscribe to if that what I have to do.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Google offers real-time quotes now. For instance:
http://www.google.com/finance?q=NASDAQ:CSCO
Even though they don't seem to provide a data feed, it would be easy to extract the real-time price from the page because it is always in a span of class "pr":
<span class="pr" id="ref_99624_l">18.33</sp an>
Pseudo-code:
1. Fetch Google Finance page w/ stock symbol in the URL
2. Search text for class="pr"
3. Extract the value between the next pair of angle brackets like >18.33<
This doesn't even require HTML/DOM parsing, just simple text searches.
http://www.google.com/finance?q=NASDAQ:CSCO
Even though they don't seem to provide a data feed, it would be easy to extract the real-time price from the page because it is always in a span of class "pr":
<span class="pr" id="ref_99624_l">18.33</sp
Pseudo-code:
1. Fetch Google Finance page w/ stock symbol in the URL
2. Search text for class="pr"
3. Extract the value between the next pair of angle brackets like >18.33<
This doesn't even require HTML/DOM parsing, just simple text searches.
ASKER
Thanks for the response. Well, I need use a program like Perl or PHP to access a real time server, not from a broswer. Some of the severs, though in realtime, have asychronous mechanisms in displaying the quotes in web pages in fancy formats in broswers, but my program doesn/t know the secret of the transaction and can't simply get a one shot page to parse as jone1619 talked about. May be I am missing something. Can anyone give me a Perl or Javascript example for accessing a real realtime server?
Thanks again
ASKER
Thanks for the help
ASKER
Thank for the help
http://www.nasdaq.com/aspx/nasdaqlastsale.aspx?symbol=GOOG&selected=GOOG