Yahoo Finance

Status
Not open for further replies.

jayie1975

New Member
Messages
4
Reaction score
0
Points
0
I wrote a WordPress widget that extracts data from Yahoo Finance in the form of a csv file (written in PHP). I last tested it a week ago and it worked fine. I came back to it yesterday (thurs) and it's stopped working. It now runs really slowly and doesn't produce any results. I believe it is using up a lot of CPU time because my account got suspended.

I narrowed it down to the Yahoo Finance call because I "commented" that part out and the rest of the Widget worked fine.

A friend of mine installed it on his HostGator account and it works fine.

Can you tell me if there has been any change to the system that would stop this.

Many thanks,

Jason.

---------- Post added at 10:50 AM ---------- Previous post was at 08:19 AM ----------

An update....

Just been to my WordPress website to try again and it suspended my account. Managed to unsuspend it automatically. I believe it's the following code in my WordPress Widget that is causing the problem, even though it has been working fine for a while now:


$live = "http://download.finance.yahoo.com/d/quotes.csv?s=" . $symbol . "&f=b";
try
{
/* Open live data */
if (!($file=@fopen($live,"r"))) throw new Exception('');

/* Show live data */
while(!@feof($file))
{
$currentprice = @fgets($file);
}
/* Close file */
@fclose($file);
}
catch (Exception $e)
{
echo "<p><strong>Unable to open stock data.</strong></p>";
}

I've "commented" out this code now and it seems fine. But i'm not sure why all of a sudden it's stopped working?

Many thanks,

Jason.
 

jayie1975

New Member
Messages
4
Reaction score
0
Points
0
An update on this problem. I had a response from "lemon-tree" on another thread that this problem might be due to port blocking from the free servers.

If this is the case how do I go about adding the "download.finance.yahoo.com" website to the whitelist? Since this is the website I call from PHP to download the stock data.

Many thanks,

Jason.
 
Status
Not open for further replies.
Top