{"id":43,"date":"2015-10-30T18:50:12","date_gmt":"2015-10-30T13:20:12","guid":{"rendered":"http:\/\/madhurendra.com\/?p=43"},"modified":"2015-10-30T18:50:12","modified_gmt":"2015-10-30T13:20:12","slug":"getting-whatsapp-statistics-whatsappweb","status":"publish","type":"post","link":"https:\/\/madhurendra.com\/getting-whatsapp-statistics-whatsappweb\/","title":{"rendered":"Getting whatsapp statistics – WhatsappWeb"},"content":{"rendered":"
There are no tool available for whatsapp which give us how many messages a user has contributed to group, Sometimes you need.<\/p>\n
Whatsapp web exposes whatsapp to JS, whiche makes things more easy,
\nI wrote a simple code which logs Number of messages sent by each user of group, obviously you need full conversation open in web, You can use Home Key to do that, <\/p>\n
The code was written in few minutes so it doesn’t have proper validations or automation,<\/p>\n
But is good for purpose.
\nOpen whatsappWeb and after opening complete conversation of group execute the following code in Google Chrome – Developer Console<\/p>\n
var v = document.querySelectorAll('.msg.msg-group .text-clickable');\r\nvar t, count ={};\r\nfor(var i=0,l=v.length;i<l;++i){\r\nt = v[i].textContent.trim();\r\n if(typeof count[t]=== 'undefined')\r\n\tcount[t]=0;\r\n ++count[t];\r\n}\r\n\r\nconsole.log(count);<\/pre>\n","protected":false},"excerpt":{"rendered":"There are no tool available for whatsapp which give us how many messages a user has contributed to group, Sometimes you need. Whatsapp web exposes whatsapp to JS, whiche makes things more easy, I wrote a simple code which logs Number of messages sent by each user of group, obviously you need full conversation open … <\/p>\n