http://chart.yahoo.com/table.csv?a=1&b=1&c=2003&d=1&e=15&f=2003&s=aapl&y=0&g=d&ignore=.csv
where | ||
a | is the starting month | |
b | is the starting date | |
c | is the starting year | |
d | is the end month | |
e | is the end date | |
f | is the end year | |
g | is the quote frequency: (d)aily,(w)eekly,(m)onthly | |
s | is the stock symbol |
This driver file is read by the Perl program, getyahoo.pl. This program reads each stock quotes request, goes to Yahoo and makes a URL request. Yahoo returns a set of records as a single data item. The program strips out the headers and reformats the records with the stock symbol at the beginning.
The reformatted output file is then read by the Perl program,stockchart.pl, which puts the records in ascending order, sorted by stock and creates an HTML page, yahoo_stocks.html, with charts of the historical quotes for each stock,a sample output page is shown
Sample Code Files |
|
---|---|
click on links for files | |
stockdata.txt: |
driver file |
getyahoo.pl: |
yahoo extract program |
stockchart.pl: |
chart creation program |
yahoo_stocks.html: |
sample HTML page |