foreach $line (<STK>) { ($stock) = split(/ /, $line); $hist = `curl -s "http://ichart.finance.yahoo.com/table.csv?s=$stock +&a=3&b=12&c=2008&d=8&e=5&f=2009&g=d&ignore=.csv" | grep -v Date `; }
I am trying to use download history data from Yahoo!Finance by passing parameters to a url, e.g, starting date and ending date parameters.
In the above code, the expected result is stock data from 03/12/2008 to 08/05/2009. But the actual data returned includes data for all the time, for example, data of the year 1984. I use curl -v option to see the details. The output is included as follows.
* About to connect() to ichart.finance.yahoo.com port 80
* Trying 76.13.114.89... connected
* Connected to ichart.finance.yahoo.com (76.13.114.89) port 80
> GET /table.csv?s=AAPL HTTP/1.1
> User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
> Host: ichart.finance.yahoo.com
> Accept: */*
From the output above, I find the parameters &a=3&b=12&c=2008&d=8&e=5&f=2009&g=d&ignore=.csv are not in the Get request.
I am new to perl and would like to get feedback from here. Thanks.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |