0

yahoo.finance.historicaldata' has been blocked. It exceeded the allotted quotas of either time or instructions

This morning I fired up the app I am developing and immidiately got the message: yahoo.finance.historicaldata' has been blocked. It exceeded the allotted quotas of either time or instructions. Worked yesteday when I shut it down for the night. Also worked this morning on a remote web server (clone of application)

What is going on here? I am not stepping over the bounds of it's usage but still I get this message that usually blocks me with the development PC for about an hour (not exactly an hour - sometimes more sometimes less). I have my own xml table that points to:

<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">

<table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<meta>
<author>
Copied By Robert Baptie
</author>
<description>
Yahoo Finance Stock historical prices
</description>
<sampleQuery>
select * from {table} where symbol = "YHOO" and startDate = "2009-09-11" and endDate = "2010-03-10"
</sampleQuery>
</meta>
<bindings>
<select itemPath="quotes.quote" produces="XML">

<urls>
<url>
http://ichart.finance.yahoo.com/table.csv
</url>
</urls>

<inputs><table xmlns="http://query.yahooapis.com/v1/schema/table.xsd">
<key id="s" as="symbol" type="xs:string" paramType="query" required="true"/>
<key id="startDate" type="xs:string" paramType="variable" required="true"/>
<key id="endDate" type="xs:string" paramType="variable" required="true"/>
<key id="a" as="startMonth" type="xs:string" paramType="query" required="false" default="1"/>
<key id="b" as="startDay" type="xs:string" paramType="query" required="false" default="1"/>
<key id="c" as="startYear" type="xs:string" paramType="query" required="false" default="2010"/>
<key id="d" as="endMonth" type="xs:string" paramType="query" required="false" default="1"/>
<key id="e" as="endDay" type="xs:string" paramType="query" required="false" default="30"/>
<key id="f" as="endYear" type="xs:string" paramType="query" required="false" default="2010"/>
<key id="g" type="xs:string" paramType="query" required="false" const="true" default="d"/>
</inputs>
<execute>
<![CDATA[ /* Parameter Value s Stock Ticker (for example, MSFT) a Start Month (0-based; 0=January, 11=December) b Start Day c Start Year d End Month (0-based; 0=January, 11=December) e End Day f End Year g Always use the letter d */ var encodedUrl = request.url; encodedUrl = encodedUrl.replace('a=1','a=' + getMonth(startDate)); encodedUrl = encodedUrl.replace('b=1','b=' + getDay(startDate)); encodedUrl = encodedUrl.replace('c=2010','c=' + getYear(startDate)); encodedUrl = encodedUrl.replace('d=1','d=' + getMonth(endDate)); encodedUrl = encodedUrl.replace('e=30','e=' + getDay(endDate)); encodedUrl = encodedUrl.replace('f=2010','f=' + getYear(endDate)); var results = y.query("select * from csv(0,1) where url=@url",{url:encodedUrl}); var colNames=''; var rows=results.results.row; for each (var row in rows) { for each (var item in row.*) { var txt = item.text().toString(); colNames=colNames + ',' + txt.replace(' ', '_'); } } colNames = colNames.substring(1); results = y.query("select * from csv(2,0) where url=@url and columns=@columnsNames",{url:encodedUrl,columnsNames:colNames}); var quotes = <quotes/>; rows=results.results.row; for each (var row in rows) { quotes.quote += <quote date={row.Date.text().toString()}>{row.*}</quote>; } response.object = quotes; function getDay(date) { var n = date.substr(8,2); if (n.substr(0, 1)=="0") { n = n.substr(1, 1); } return '' + (parseInt(n)); } function getMonth(date) { var n = date.substr(5,2); if (n.substr(0, 1)=="0") { n = n.substr(1, 1); } return '' + (parseInt(n)-1); } function getYear(date) { return date.substr(0,4) } ]]>
</execute>
</select>
</bindings>
</table>

This is the query code:

$these_symbols = implode(',', $stocks_to_extract);
$consumer = new OAuthConsumer(key, secret);
if (is_null($consumer)) {
echo 'Application Session is empty';
die();
}
$request = OAuthRequest::from_consumer_and_token($consumer, null, 'GET', 'https://api.login.yahoo.com/oauth/v2/get_request_token');
$request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, null);
$host = $_SERVER['HTTP_HOST'];
$data_table = 'http://' . $host . '/import_data/myHistoricalTables.xml';

$yql_query_url = '?q=use%20\'' . urlencode($data_table) . '\'%3B%20';
$yql_query_url .= "select%20*%20from%20yahoo.finance.historicaldata";
$yql_query_url .="%20where%20symbol%20in%20($these_symbols)%20";
$yql_query_url .="and%20startDate%20%3D%20%22$sd%22%20and%20endDate%20%3D%20%22$ed%22";
$yql_query_url .="&format=xml&diagnostics=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys";

$request2 = OAuthRequest::from_consumer_and_token($consumer, null, 'GET', 'http://query.yahooapis.com/v1/yql' . $yql_query_url);
$request2->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, null);
.
.


$curl2 = curl_init($request2->to_url());
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl2, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl2, CURLOPT_SSL_VERIFYPEER, 0);
$xmlObj = curl_exec($curl2);


works like a dream other than this persistant issue .

How can I set about resolving this issue??

Robert

by
5 Replies
  • The exact message returned from the server is:

    (string) <?xml version="1.0" encoding="UTF-8"?>
    <query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="0" yahoo:created="2011-04-10T08:27:30Z" yahoo:lang="en-US"><diagnostics><publiclyCallable>true</publiclyCallable><url execution-time="1" proxy="DEFAULT"><![CDATA[http://www.datatables.org/yahoo/finance/yahoo.finance.historicaldata.xml]]></url><javascript name="yahoo.finance.historicaldata" verb="select"><![CDATA[The current table 'yahoo.finance.historicaldata' has been blocked. It exceeded the allotted quotas of either time or instructions]]></javascript><user-time>22</user-time><service-time>1</service-time><build-version>12146</build-version></diagnostics><results/></query><!-- total: 22 -->
    <!-- engine5.yql.sp2.yahoo.com -->
    0
  • This is really fundamental.

    Does no one have an idea where I should start with this?
    0
  • Does the message apply to just this instance of the application or is this particular instance of the table at location x blocked for all. Given that it works on my web server clone then must be accessing a different source? If so how do I round robin on these?

    I need to circumvent this issue some how - any help or general comments here would be appreciated
    0
  • Did this problem ever get resolved? I am having the same problem, but then I noticed that at the time of this posting the system appears to be down.

    http://www.downforeveryoneorjustme.com/query.yahooapis.com

    google would never have this problem...
    0
  • http://stackoverflow.com/questions/4775339/yql-problem-the-current-table-has-been-blocked

    0

Recent Posts

in YQL