NAME getstockquote - Embeddable Perl script for fetching stock and mutual fund quote data from various exchanges. INSTALLATION Installation is straightforward. Move the getstockquote.tar.gz file to the directory in which you'd like it to live. Then: tar zxvf getstockquote-1_01.tar.gz You'll end up with this readme and the getstockquote script. Make sure the script is still executable and you're set. USAGE General sytax: /path/to/getstockquote [--fontsize=1..6] [--verbose=yes|no] [ticker2] ... Options: fontsize - Size of HTML font returned. Values: 1 = very small 2 = kinda small (default) 3 = normal size 4 = kinda large 5 = large 6 = damn big verbose - Return either a small or large set of data. Values: yes = return everything no = return only symbol, last , high, low (default) Script can be called as a server-side exec: Script can be called from another Perl script: print `/path/to/getstockquote `; or print system("/path/to/getstockquote "); Note that using this from a CGI script (as in the examples above) without trapping errors, checking for malicious input, etc. is not recommended and may represent an enourmous security risk. Do this AT YOUR OWN PERIL! DESCRIPTION getstockquote.pl uses the Finance::Quote Perl module to fetch stock data for one or more ticker symbols and returns an HTML table on STDOUT with each ticker symbol followed by that stock's data. This script was originally designed to be called via a server-side exec with a stock quote source and one or more stock ticker symbols given as command-line arguments, but can be called from a regular CGI script, from PHP, or even the command line with a little modification. It can retrieve data from the following sources: NYSE quotes Europe quotes Fidelity Investments Quotes Quotes from T. Rowe Price Quotes from Vanguard Group Australian quotes from ASX Annuities from TIAA-CREF For each symbol, it returns the following data: Last Price Highest trade today Lowest trade today Last Trade Date and Time (MM/DD/YY HH:MM AM|PM format) Percent Change from previous day's close Volume Bid Ask Previous Close Today's Open The symbol and data are returned on STDOUT as an HTML table. The stock data which get returned can be customized. The script can either return the full list above (the dafault) or just ticker, price, high, low. Set this with the --verbose option. The fontsize variable sets the size of the font, overriding the default, which is 2. Set it to a value ranging from 1 to 6. These numbers correspond (oddly enough) to HTML absolute sizes. If you call the script with invalid input, it will return HTML which tells you what it expects. Think of it as online help... :-) COPYRIGHT Copyright (C) 2000, William Rhodes This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The information that you obtain with this script may be copyrighted by Yahoo! Inc., and is governed by their usage license. See http://www.yahoo.com/docs/info/gen_disclaimer.html for more information. The information that you obtain with this script may be copyrighted by the ASX, and is governed by its usage license. See http://www3.asx.com.au/Fdis.htm for more information. The information that you obtain with this script may be copyrighted by TIAA-CREF, and is governed by its usage license. Other copyrights and conditions may apply to data fetched through this script. AUTHOR William Rhodes THANKS I would like to express my sincere thanks to the authors of the amazing Finance::Quote Perl module: Dj Padzensky , PadzNet, Inc. Linas Vepstas Yannick LE NY Paul Fenwick Brent Neal This script wouldn't have been nearly as easy without their work. (And writing this README -- my very first -- wouldn't have been easy without cribbing their README.) In fact, this script replaces an older, much larger LWP-based script which was a complete hack (and not in the good sense). If you find this script useful, please let me know. If you make any changes, I'd appreciate it if you sent them to me for inclusion in future versions. Bug reports are also very welcome. Some web sites that may interest you: The Finance::Quote home page: http://finance-quote.sourceforge.net/ The Finance::YahooQuote home page: http://www.padz.net/~djpadz/YahooQuote/