Answer the question
In order to leave comments, you need to log in
How to react that one of the friends of a user has logged out or logged into VK?
How to react that one of the friends of a user has logged out or logged into VK?
For example:
The program constantly goes through the friends of a particular user. If the user was online online: 1 , and left VK, thereby online: 0 , then output to the console:
- User such and such logged out from VK
Or if the user was offline online: 0 , and then went to VK online: 1 , then output to the console:
- User such and such logged into VK
Answer the question
In order to leave comments, you need to log in
Well, everything is as you described only in any programming language that you know
Is there a program code?
All this is quite possible to do with just one api vk.
Use the VK API:
vk.com/dev/friends
Using friends.get, you can get a list of the user's friends. (their id).
Create a timer for 5-10-15-20-30-60 seconds that will check the previously received id, and then:
The program constantly goes through the friends of a particular user. If the user was online online: 1, and left VK, thereby online: 0, then output to the console:
- User such and such logged out from VK
Or if the user was offline online: 0, and then went to VK online: 1, then output to the console:
- User such and such logged into VK
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question