For years I've been running a daily curl script that tracks stock quotes through Yahoo finance. Just the other day the CURL request stopped working.
The URL that I'm using works fine in a browser and gives me the option of downloading the CSV. Here is the URL:
If you click on this link it will ask you about opening a CSV file on your computer which gives the exact fields that I want.
Previously this worked fine using a CURL request. But as of last Thursday something changed. It may be that Yahoo changed something or my PHP version may have been upgraded on my hosting server which caused something to not work.
Here's the code that worked fine until last Thursday.
$url = "http://download.finance.yahoo.com/d/quotes.csv?s=AAWW+ATTU+CJES+CLRO&f=sd1noghl1vpt7t8erdjka2j4j1m3m4w1ba";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$var = curl_exec($ch);
print 'CURL RESPONSE: <textarea cols=100 rows=25>'.$var.'</textarea>'; die ("at stockPull stop point");
In the past, this textarea would show the same data that you see from going straight to the URL. But now it just gets caught in a loop that gives an error message in the logs of:
mod_fcgid: read data timeout in 120 seconds, referer: http://www.mydomain.com/look.php?a=new
Premature end of script headers: look.php, referer: http://www.mydomain.com/look.php?a=new
Any insight into why the CURL request no longer works would be appreciated.