0
错误的file_get_contents我有以下问题:当运行此脚本与Twitter的搜索API
$url = 'http://search.twitter.com/search.json?q=obama';
$tw = file_get_contents($url,0,null,null);
我收到此消息。
Warning (2): file_get_contents(http://search.twitter.com/search.json?q=obama) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 420 Client Error (420)
但这很奇怪,因为它一直在工作! 你能帮我吗? 添加...我试图使用卷曲这样
$url = 'http://search.twitter.com/search.json?q=obama';
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $url);
$contents = curl_exec($c);
echo $contents;
curl_close($c);
但调用返回此消息 “错误”:“你已经速率限制增强你的平静。”},它似乎荒谬,因为我没有以前没有提出任何要求。