Simple JS to monitor offline and online time of a contact.
source link: https://gist.github.com/parthpower/d0fb6a1196fd8cefebde
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
WhatsApp On Web Monitor
What It does
It gives notifications when someone goes online or offline or typing. Open chat of the contact you want to monitor and start script.
Simple Way
- Create a bookmark and Add the content of bookermarklet as url. (or goto http://parthpower.github.io/serviceworkers/whatsappmonitor.html)
- Goto whatsapp on web and click on the bookmark.
- Open chat of the contact you want to monitor.
Tweet me @parthpower for bug reports or feature request. Special thanks to @jdcpower1994 for helping.
It also does not give offline notification
It works if i keep switcvhing between the chats but gives only one notification if i opened asingle chat
yiorenl commented on Aug 20, 2018 •
Hi there, i'm facing the same issues as @bendash. Is there a workaround to solve that problem? It only sees the first time some is online. The other status are not recorded.
philbarney commented on Sep 8, 2018 •
Hi,
Great job, thanks a lot for this code. I slightly adapted it to also track when the status is changing from online to offline.
Tried twice right now but it seems to do nothing, I click on the bookmark and nothing happens while whatsappweb opened.
Is this not working?
@philbarney could you gist your adapted code?
Hi there, i'm facing the same issues as @bendash. Is there a workaround to solve that problem? It only sees the first time some is online. The other status are not recorded.
This JS code works fine on Whatsapp with an english interface. Change your language from your smartphone to English. Otherwise the recording doesn't work.
Hi there, i'm facing the same issues as @bendash. Is there a workaround to solve that problem? It only sees the first time some is online. The other status are not recorded.
This JS code works fine on Whatsapp with an english interface. Change your language from your smartphone to English. Otherwise the recording doesn't work.
What lines do we need to change in order to let this work, when using another language than the default (en)?
I think I found a couple of bugs...
-
On line 13 you set the var cvsContent, which I think you overwrite in line 75 (function stalk());
Why do we need that again? -
Line 102 says "flase", where it should be "false";
Fact is, that there is never more logged than 1 event, although I'm pretty sure there are more events... What could I check?
please be gentle, I'm a noob when it comes to JS and programming. Still learning...
I am too stupid...where can I find the file ?
First I open whatsapp in Firefox and open a chat, than I push F12 and copy the script in the console. I push ENTER and on screen I see "stalk". And now ??? What must I do know or ist it a mistake ? Please help me.
gnncl commented on May 9, 2019
The display language of your android or ios device must be in english.
Sample View
It's a pity you have to refresh to get multiple notifications. Now it only registers the first one.
any possibility for logging the activity of the stalked subject?
Hi,
Great job, thanks a lot for this code. I slightly adapted it to also track when the status is changing from online to offline.
mind uploading the code
Something new on the script? It only save one entry...
Gives notification only once then again I have to press stop stalking and start and then again it gives notification once
it is the same for me. one notification and it does not show when the person goes offline
Hi,
Great job, thanks a lot for this code. I slightly adapted it to also track when the status is changing from online to offline.
I know it's been awhile, but could you share the link?
I think I found a couple of bugs...
- On line 13 you set the var cvsContent, which I think you overwrite in line 75 (function stalk());
Why do we need that again?- Line 102 says "flase", where it should be "false";
Fact is, that there is never more logged than 1 event, although I'm pretty sure there are more events... What could I check?
please be gentle, I'm a noob when it comes to JS and programming. Still learning...
did you manage to get it to work?
zkxnkj commented on Jan 26, 2020 •
This chrome extension ist working:
https://github.com/supernova13892/whatsapp_stalker
thank you, so much! this seems to be working with multiple users as well. nice!
edit: sadly, it is not working for me for whatever reason, as no entries get recorded
This chrome extension ist working:
https://github.com/supernova13892/whatsapp_stalker
I found another one that works and shows offline time as well, but has no notifications and you can only view one contact at a time: https://gist.github.com/rkhayyat/0f93f9f51ae40d6df3daf123182ee27b
not showing typing.
Hallo,
is with this function the user asked to change permission in his app with a message?
or what does this mean?
//Modified Code from Notifiaction API example from MDN
function checkPermission() {
// Let's check if the browser supports notifications
if (!("Notification"in window)) {
return flase;
}// Let's check whether notification permissions have already been granted
else if (Notification.permission === "granted") {
// If it's okay let's create a notification
return true;
}// Otherwise, we need to ask the user for permission
else if (Notification.permission !== 'denied') {
Notification.requestPermission(function(permission) {
// If the user accepts, let's create a notification
if (permission === "granted") {
return true;
Author
parthpower commented on Jul 31, 2020
@meins-rbg that's right, it is to check if the browser supports notifications API and check/ask permission to allow notifications.
From https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API
Thanks, is there a solution for only "registers the first one" without changing the language?
Hello everyone.
How to build an app like whatsdog, that checks online-offline notification of a contact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK