| 1 |
$Id: README.txt,v 1.1 2005/10/23 18:21:03 kbahey Exp $ |
$Id$ |
| 2 |
|
|
| 3 |
Description: |
Description: |
| 4 |
------------ |
------------ |
| 18 |
* The stock data in the table are periodically refreshed from Yahoo, |
* The stock data in the table are periodically refreshed from Yahoo, |
| 19 |
at an admin specified interval. |
at an admin specified interval. |
| 20 |
|
|
|
* The number of rows to update every cron run is also configurable. |
|
|
|
|
|
Demos: |
|
|
------ |
|
|
|
|
|
http://buyblue.org uses this module for stock quotes |
|
|
|
|
|
http://2bits.com/stock has the stock module installed, which uses |
|
|
this stockapi module. |
|
|
|
|
| 21 |
Database: |
Database: |
| 22 |
--------- |
--------- |
| 23 |
|
|
| 31 |
- Enable the module in Administer > Modules |
- Enable the module in Administer > Modules |
| 32 |
- You can change the update frequency in Administer > Settings > StockAPI |
- You can change the update frequency in Administer > Settings > StockAPI |
| 33 |
|
|
| 34 |
|
API Instructions |
| 35 |
|
---------------- |
| 36 |
|
Retrieve Apple's stock quote from Yahoo! |
| 37 |
|
|
| 38 |
|
$stock = stockapi_fetch(array('AAPL')); |
| 39 |
|
|
| 40 |
|
Retrieve multiple stocks from Yahoo! |
| 41 |
|
|
| 42 |
|
$symbols = array('AAPL', 'GOOG', 'MSFT', 'SBUX'); |
| 43 |
|
$stocks = stockapi_fetch($symbols); |
| 44 |
|
|
| 45 |
|
Caching the stock information locally: |
| 46 |
|
|
| 47 |
|
foreach ($stocks as $key => $stock) { |
| 48 |
|
stockapi_save(_stockapi_to_object($stock)); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
|
Loading a stock from cache |
| 52 |
|
|
| 53 |
|
$stock = stockapi_load('AAPL'); |
| 54 |
|
|
| 55 |
|
Loading multiple stocks from the cache |
| 56 |
|
|
| 57 |
|
$symbols = array('AAPL', 'GOOG', 'MSFT', 'SBUX'); |
| 58 |
|
$stocks = stockapi_multiload($symbols); |
| 59 |
|
|
| 60 |
Bugs/Features/Patches: |
Bugs/Features/Patches: |
| 61 |
---------------------- |
---------------------- |
| 62 |
|
|
| 67 |
Author |
Author |
| 68 |
------ |
------ |
| 69 |
|
|
| 70 |
Originally developed by Matt Westgate http://asitis.org for BuyBlue.com |
Originally developed by Matt Westgate http://www.lullabot.com/ |
| 71 |
|
|
| 72 |
Modified and maintained by Khalid Baheyeldin http://baheyeldin.com/khalid |
Modified and maintained by Khalid Baheyeldin http://baheyeldin.com/khalid |
| 73 |
and http://2bits.com |
and http://2bits.com |