0

У меня есть много разных групп, из которых нужно получить последние посты (сделать несколько обращений к execute по 25 групп) через execute, объединить все эти посты в массив и вернуть. Вот JS, который у меня сейчас есть:

var posts = [];var count = 100;posts = posts + API.wall.get({"count": count, "owner_id":"-24834794"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-29534144"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-15755094"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-40316705"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-49388814"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-65960786"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-30022666"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-32754081"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-23213239"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-59415172"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-46270186"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-3653319"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-34072502"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-66687279"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-10639516"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-35294456"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-45091870"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-76709587"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-72831913"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-22231730"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-40232010"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-22942343"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-61560900"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-29302425"}).items;
posts = posts + API.wall.get({"count": count, "owner_id":"-52537634"}).items;
return posts;

В итоге это возвращает какую-то околесицу, ну и если попытаться уже у себя объединить результаты нескольких таких запросов с разными группами, то тоже ничего не выходит. Что делать?

3
  • возвращает какую-то околесицу - это не тот термин, которыми следует оперировать задавая точный вопрос и желая получить точный ответ на конкретную проблему.............в один массив запихать может нужно использовать push ? 16 мар 2016 в 12:31
  • @АлексейШиманский странно, но сейчас push заработал. Раньше я получал ошибку, что, мол, для push требуется массив, хотя массив был.
    – devtwo
    16 мар 2016 в 12:36
  • Странно. Прямо сейчас запустил код и у меня всё замечательно работает. 2 мар 2023 в 6:22

0

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge you have read our privacy policy.

Посмотрите другие вопросы с метками или задайте свой вопрос.