There is an interesting procedure for execute (I am reproducing the code from this topic below), which allows you to extract comments from a particular user from the community, or else all comments in a row, if the user_id parameter user_id not passed.

Until recently, everything worked, but after changes to the VC and the introduction of sub-answers - which are not considered to be comments - they stopped falling into the results of the procedure. Is it possible to upgrade?

 var owner_id = Args.owner_id; var user_id = Args.user_id; var offset = Args.offset; var post_count = Args.post_count; if (post_count == null) post_count = 10; // Получаем список постов var posts = API.wall.get({ "owner_id": owner_id, "offset": offset, "count" : 100, }); var i = 0; var userComments = {}; while(i < posts.items.length && i < post_count) { var post_id = posts.items[i].id; var comments = API.wall.getComments({ "owner_id": owner_id, "post_id": post_id, "count" : 100, }); var j = 0; while(j < comments.items.length) { if (user_id == null || comments.items[j].from_id == user_id) userComments.push(comments.items[j]); j = j + 1; } i = i + 1; } return userComments; 
  • I found out that in the output of the procedure for each comment count appears with the number of comments - "count": 1 . But how to get them too? - iskander1220 8:38 pm

0