Answer the question
In order to leave comments, you need to log in
How to call given vk api method in loop with 340ms delay?
There is the following code:
var owner_id = -51016572;
var offsetPost = 0;
var wallPostsArray = [];
var totalPosts;
VK.Api.call('wall.get', {owner_id: owner_id, count: 100, offset: offsetPost, filter: 'owner'}, function(res) {
if(res.response) {
totalPosts = res.response[0]; //Всего постов в паблике от имени группы
for(var i = 1; i < res.response.length; i++){
wallPostsArray.push(res.response[i]); //Массив объектов состоящий из постов группы
}
}else if(res.error){
console.log(res.error);
}
});
Answer the question
In order to leave comments, you need to log in
setInterval(() => {
offsetPost += 100;
VK.Api.call('wall.get',
....
}, 340)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question