WhatsApp has a feature called 'last seen' where it tells the user when was the last time user's contacts were using WhatsApp. There is a catch though, if you have disabled this feature, you won't be able to see others last seen status even if they have enabled it. Which I think is a good, 'if you don't let me see yours, then you can't see mine.'
But, WhatsApp will let everyone know whether the user has opened its application or not by means of 'online' status message. The status message will disappear as soon as the user closes the app. This made me thinking whether I can track the 'online' status and keep a log of the same to find out out even more information about the user activity.
I used WhatsApp web and python to do the tracking.
Using the chrome inspect tool, we can find the class of the 'online' status(Fig 1), which can used to track the status.
So using Selenium framework for web automation in Python, I was successfully able to track the status. Now, I polled the status information every one second and used the logic as per the Fig 2 to log the online time.
I extended similar logic to other websites as well, Facebook and Instagram.
In Whatsapp.
- Tracks the total online time, start and end time of each online session.
In Facebook.
-Similar to WhatsApp, tracks total time, start and end time of each online session.
In Instagram.
-Tracks likes count, followers, following and total post counts of a particular person or a post.
Comments