R
R
rusgayfer2018-03-08 13:20:07
In contact with
rusgayfer, 2018-03-08 13:20:07

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

2 answer(s)
V
VK API, 2018-03-09
@rusgayfer

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.

P
Puma Thailand, 2018-09-15
@opium

Fewer requests to send or wish it through a bunch of proxies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question