php Getting a Stock Price

991 views
Skip to first unread message

Warren Michelsen

unread,
Oct 16, 2010, 10:18:59 AM10/16/10
to Web Authoring List
Is there a way in php to get a current stock price and put it into a php variable? I'd like to be able to say:
$APPLprice = [some code to get the price from http://finance.google.com/finance?q=AAPL];

I've thought of using curl on the page and parsing the result but wondered if this can be done in php.

Scout

unread,
Oct 18, 2010, 11:49:07 AM10/18/10
to Web Authoring
It can be done in PHP. In the next day or so, there will be a tutorial
on this very topic posted at http://www.communitymx.com/. It is called
"Using PHP cURL and simple_html_dom When There is No RSS Feed."



On Oct 16, 7:18 am, Warren Michelsen <wmichel...@mac.com> wrote:
> Is there a way in php to get a current stock price and put it into a php variable? I'd like to be able to say:
> $APPLprice = [some code to get the price fromhttp://finance.google.com/finance?q=AAPL];

haj...@gmail.com

unread,
Sep 5, 2013, 1:02:22 AM9/5/13
to web-au...@googlegroups.com, wmich...@mac.com
I'm not sure about Google Finance but I've written a PHP function which uses Yahoo! Finance to get stock data. My function reads the data from .csv file and return an array containing the stock data. For the code and sample results, feel free to check out my blog.
Reply all
Reply to author
Forward
0 new messages