Link to home
Start Free TrialLog in
Avatar of zzhang2006
zzhang2006Flag for United States of America

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
Avatar of Brian Withun
Brian Withun
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jones1618
jones1618

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</span>

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.
Avatar of zzhang2006

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
Thanks for the help
Thank for the help