| 1 |
$Id$
|
| 2 |
|
| 3 |
Description:
|
| 4 |
------------
|
| 5 |
|
| 6 |
This is a stock quote api module that provides other modules with a facility
|
| 7 |
to incorporate stock data in them.
|
| 8 |
|
| 9 |
Features:
|
| 10 |
---------
|
| 11 |
|
| 12 |
This module provides several features and options:
|
| 13 |
|
| 14 |
* When a stock is first queried, the request goes over the internet to
|
| 15 |
Yahoo Finance. The data retrieved is then stored in a database
|
| 16 |
table for later fetches by modules.
|
| 17 |
|
| 18 |
* The stock data in the table are periodically refreshed from Yahoo,
|
| 19 |
at an admin specified interval.
|
| 20 |
|
| 21 |
Database:
|
| 22 |
---------
|
| 23 |
|
| 24 |
This module requires that the database table 'stockapi' be created.
|
| 25 |
|
| 26 |
Installation:
|
| 27 |
-------------
|
| 28 |
|
| 29 |
- Cron must be configured correctly and running on your site
|
| 30 |
- Copy the stockapi module directory to the modules directory
|
| 31 |
- Enable the module in Administer > Modules
|
| 32 |
- 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:
|
| 61 |
----------------------
|
| 62 |
|
| 63 |
If you want to report bugs, feature requests, or submit a patch, please do so
|
| 64 |
at the project page on the Drupal web site.
|
| 65 |
http://drupal.org/project/stockapi
|
| 66 |
|
| 67 |
Author
|
| 68 |
------
|
| 69 |
|
| 70 |
Originally developed by Matt Westgate http://www.lullabot.com/
|
| 71 |
|
| 72 |
Modified and maintained by Khalid Baheyeldin http://baheyeldin.com/khalid
|
| 73 |
and http://2bits.com
|
| 74 |
|
| 75 |
The author(s) can also be contacted for paid customizations of this
|
| 76 |
and other modules.
|