local.yahooapis.com ジオコード インターフェイスに対してジオコード リクエストを作成しようとしています。これは昨日、同じ AppID とハードコードされたアドレスで機能していました。これで、クエリ文字列を分割し、データベースからプログラムで入力しました。API は 403 - Forbidden エラーを返します。スロットリング制限に達したのか、リファクタリングでリクエストを台無しにしたのかはわかりません。
「MY_APP_ID」を下塗りしたリクエスト:
Warning: file_get_contents(http://local.yahooapis.com/MapsService/V1/geocode?appid=MY_APP_ID&street=6727+N+5TH+ST&city=PHILADELPHIA&state=PA&output=php) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
そして前後の全体のwireshark:
GET /MapsService/V1/geocode?appid=MY_APP_ID&street=BOX+269&city=TOUGHKENAMON&state=PA&output=php HTTP/1.0
Host: local.yahooapis.com
HTTP/1.1 403 Forbidden
Date: Mon, 19 Jul 2010 14:46:42 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Yahoo! - 403 Forbidden</title><style>
/* nn4 hide */
/*/*/
body {font:small/1.2em arial,helvetica,clean,sans-serif;font:x-small;text-align:center;}table {font-size:inherit;font:x-small;}
html>body {font:83%/1.2em arial,helvetica,clean,sans-serif;}input {font-size:100%;vertical-align:middle;}p, form {margin:0;padding:0;}
p {padding-bottom:6px;margin-bottom:10px;}#doc {width:48.5em;margin:0 auto;border:1px solid #fff;text-align:center;}#ygma {text-align:right;margin-bottom:53px}
#ygma img {float:left;}#ygma div {border-bottom:1px solid #ccc;padding-bottom:8px;margin-left:152px;}#bd {clear:both;text-align:left;width:75%;margin:0 auto 20px;}
h1 {font-size:135%;text-align:center;margin:0 0 15px;}legend {display:none;}fieldset {border:0 solid #fff;padding:.8em 0 .8em 4.5em;}
form {position:relative;background:#eee;margin-bottom:15px;border:1px solid #ccc;border-width:1px 0;}
#s1p {width:15em;margin-right:.1em;}
form span {position:absolute;left:70%;top:.8em;}form a {font:78%/1.2em arial;display:block;padding-left:.8em;white-space:nowrap;background: url(http://us.i1.yimg.com/us.yimg.com/i/s/bullet.gif) no-repeat left center;}
form .sep {display:none;}.more {text-align:center;}#ft {padding-top:10px;border-top:1px solid #999;}#ft p {text-align:center;font:78% arial;}
/* end nn4 hide */
</style></head>
<body><div id="doc">
<div id="ygma"><a href="http://us.rd.yahoo.com/403/*http://www.yahoo.com"><img
src=http://us.i1.yimg.com/us.yimg.com/i/yahoo.gif
width=147 height=31 border=0 alt="Yahoo!"></a><div><a
href="http://us.rd.yahoo.com/403/*http://www.yahoo.com">Yahoo!</a>
- <a href="http://us.rd.yahoo.com/403/*http://help.yahoo.com">Help</a></div></div>
<div id="bd"><h1>Sorry, Forbidden.</h1>
You don't have permission to access this URL on this server.<P>
<P>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.
<p>Please check the URL for proper spelling and capitalization. If
you're having trouble locating a destination on Yahoo!, try visiting the
<strong><a
href="http://us.rd.yahoo.com/403/*http://www.yahoo.com">Yahoo! home
page</a></strong> or look through a list of <strong><a
href="http://us.rd.yahoo.com/403/*http://docs.yahoo.com/docs/family/more/">Yahoo!'s
online services</a></strong>. Also, you may find what you're looking for
if you try searching below.</p>
<form name="s1" action="http://us.rd.yahoo.com/403/*-http://search.yahoo.com/search"><fieldset>
<legend><label for
私が間違っていることを特定できますか、または新しい制限について AppID を確認できる場所を教えてください。
アップデート:
私は真新しいappidで試しました。スクリプトで 5 秒間のスリープを使用し、3 つのリクエストのみを行いました。最初のリクエストは失敗しました。何がこの問題を引き起こしているのかわかりません。
警告: file_get_contents( http://local.yahooapis.com/MapsService/V1/geocode?appid=orQG_ZLV34EmNvmFaIKpOd5RSu1aBsDEfoxNeJBFhr5VUM5dItKbyXLjoMYi0Q--&street=6727+N+5TH+ST&city=PHILADELPHIA&state=PA&output=php ) [function.file-get-contents] : ストリームを開くことができませんでした: HTTP 要求が失敗しました! HTTP/1.1 403 Forbidden in C:\wamp\www\Smartphone\updategeo.php 行 23 1 警告: file_get_contents( http://local.yahooapis.com/MapsService/V1/geocode?appid=orQG_ZLV34EmNvmFaIKpOd5RSu1aBsDEfoxNeJBFhr5VUM5dItKbyXLjoMYi0Q--&street=7400 +OXFORD+AVE&city=PHILADELPHIA&state=PA&output=php ) [function.file-get-contents]: ストリームを開くことができませんでした: HTTP リクエストが失敗しました! HTTP/1.1 403 Forbidden in C:\wamp\www\Smartphone\updategeo.php 行 23 2 警告: file_get_contents(http://local.yahooapis.com/MapsService/V1/geocode?appid=orQG_ZLV34EmNvmFaIKpOd5RSu1aBsDEfoxNeJBFhr5VUM5dItKbyXLjoMYi0Q--&street=2+W+FOURTH+ST&city=BRIDGEPORT&state=PA&output=php ) [function.file-get-contents]: 開けませんでしたストリーム: HTTP 要求が失敗しました! HTTP/1.1 403 C:\wamp\www\Smartphone\updategeo.php 行 23 で禁止 3
もう一度編集してください:私の最善の推測は、開発ボックスで作業していて、別のドメインに対して appId が生成されたため、それを拒否したことです。それが正しいかどうかをどのように判断できますか? ただし、このコードはある時点で機能したため、これは私には 100% 意味がありません。