Answer the question
In order to leave comments, you need to log in
How now to check VKontakte profiles for closedness (since August 2018) using VK API methods?
When working with VK API methods, there is a limit on the number of requests to the social network (no more than three per second).
For example, the friends.getMutual method allows you to find out the mutual friends of user A and user B. Then, in order to find out all the common friends of user A with all his friends, it would be necessary to make as many friends.getMutual requests as user A has friends.
Some methods allow you to query lists. Thus, for friends.getMutual it would be possible to pass user A and a list (B, C, D, ...) of his friends and get by with only two (not always, but not the essence) requests.
The problem is as follows: if it is impossible to perform an operation for at least one user from the list, then the entire list is refused by the VC without specifying the "guilty" user. That is, if, for example, some user in the list is deleted/banned (which means that mutual friends cannot be recognized), the friends.getMutual function will not be executed. This problem could be solved by making a users.get request on the list of users, getting information about the banned ones and filtering the list from them. Thus, one additional request had to be made (about 0.34 seconds), but the problem was solved.
And now to the crux of the issue. Now VK has introduced "closed" profiles. And if there is a closed profile in the list, then requests cannot be executed either (the specific profile on which the error occurred is not indicated). But (judging by the documentation) there is no way to know if the profile is closed, that is, when users.get is requested to the list of users, the "closed / not closed" field DOES NOT EXIST, so the list cannot be filtered. So, you need to do users.get to each user and catch the error "30 This profile is private". So, it is necessary to execute again the number of requests equal to the number of users, which will be very long. Moreover, the same result can only be achieved by repeatedly calling the friends.get method.
Actually the question is: the social network itself has not yet completed the functionality after the innovation, or am I missing some method of checking the closedness of the profile?
Thanks
Answer the question
In order to leave comments, you need to log in
send requests using the users.get method with version 5.89
yes, this version is not in the documentation, but using it you can get information about the closed profile ("is_closed" field)
F12 in chrome (and like everywhere else) opens the console.
If you read the message "Uncaught TypeError: Koloda.shuffle is not a function" then it becomes clear that you are trying to call a function on an array before adding it to the prototype. Rearrange adding the function to the beginning.
PS: And try not to mix Russian and English in the names. If Koloda, then Peretasovat =)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question