모든 Twitter 요청에 대해 the returned HTTP headers should include X-RateLimit-Limit을 작성하십시오.PHP에서 Twitter의 X-RateLimit 제한을 검색하십시오.
그러나 PHP를 사용하여 검색 할 수없는 것 같습니다. 누군가 내가 뼈를 자른 실수가 무엇인지 말해 줄 수 있습니까?
정상적인 방법으로 컬을 설정했으며 GET 및 POST 요청을 성공적으로 수행 할 수 있습니다.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLINFO_HEADER_OUT, TRUE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
$response = curl_exec($ch);
$response_info=curl_getinfo($ch);
$erno = curl_errno($ch);
$er = curl_error($ch);
curl_close($ch);
나는 HTTP_CODE
$response_info['http_code']
같은 일부 응답 정보를 얻을 수 있어요하지만이 라인은 그냥 PHP 버전 5.3.10을 실행하는거야
//Doesn't bloody work. No idea why!
$rate_limit = $response_info['X-RateLimit-Limit'];
null를 돌려줍니다.
EDIT
이것은 인 print_r ($의 response_info)의 결과이고;
Array
(
[url] => https://api.twitter.com/1/statuses/home_timeline.json...
[content_type] => application/json;charset=utf-8
[http_code] => 200
[header_size] => 695
[request_size] => 410
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 1.239977
[namelookup_time] => 0.007361
[connect_time] => 0.155783
[pretransfer_time] => 0.465397
[size_upload] => 0
[size_download] => 99425
[speed_download] => 80182
[speed_upload] => 0
[download_content_length] => 99425
[upload_content_length] => 0
[starttransfer_time] => 0.794829
[redirect_time] => 0
[certinfo] => Array()
[redirect_url] =>
[request_header] => GET /1/statuses/home_timeline.json... HTTP/1.1
Host: api.twitter.com
Accept: */*
)
당신이'위해서 var_dump ($의 response_info)를 사용하여 시도 가지고, 당신이 실제로 얻고있는 것을보고' 트위터에서? – Daan
나는 X-RateLimit-Limit가 나타나지 않는다. –
흠. [account/rate_limit_status] (https://dev.twitter.com/docs/api/1/get/account/rate_limit_status) 전화가 올바른 정보를 반환합니까? – Daan