Answer the question
In order to leave comments, you need to log in
Too many requests per second error, how to fix?
This error comes from frequent requests, how can I fix it?
#Парсер VK
function pars_api($group)
{
global $token;
$Request = "owner_id=-".$group."&filter=owner&count=2&access_token=".$token."&v=5.73";
$url = 'https://api.vk.com/method/wall.get';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, urldecode($Request));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($curl);
curl_close($curl);
$a_post = json_decode($result);
global $it;
$pinned = 1;
if (($a_post->response->items[0]->is_pinned == $pinned)) // Проверяем есть ли закрепленная запись
{
$it = 1;
} else {
$it = 0;
}
if(!empty($a_post->error))
{
debug_mess("ответ error: (".$a_post->error->error_code.")".$a_post->error->error_msg,3);
send_mailo('получения');
//continue; // php 7.0 не рабит
}
return $a_post;
}
Answer the question
In order to leave comments, you need to log in
The frequency and quantity limits for API requests are described here: https://vk.com/dev/api_requests?f=3.%20%D0%9E%D0%B...
There are also restrictions on the wall.get method itself: https ://vk.com/dev/data_limits
The code itself cannot be fixed in any way, you need to fit within the limits, then there will be no errors.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question