U
U
UksusoFF2018-02-26 09:54:23
In contact with
UksusoFF, 2018-02-26 09:54:23

How to get the list of groups along with the text of the pinned message?

I'm trying to do it through execute .
On 100 groups it seems normal, but 500 already falls off: "Runtime error occurred during code invocation: Too many operations".
groups.search has a limit of 1000. Apparently this error is due to map.push(event).
Are there any options for this to work on 1000 groups?

var events = API.groups.search({
    "q" : "*",
    "future" : 1,
    "type": "event",
    "offset" : 0,
    "count" : 10,
    "fields": "description,fixed_post"
});

var map = [];
if (events.count) {
    var i = events.items.length;

    do {
        var event = events.items[i];
        if (event.fixed_post) {
            event.fixed_text = "Текст из wall.getById";
        }
        map.push(event);
        i = i - 1;
    } while (i > 0)
}

return {
    "items": map,
};

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mindgrow, 2018-02-26
@mindgrow

There is a restriction on getting groups and information about users. You can't get more than 1000 users. You can't get more than 500 groups. Just use offset

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question