{"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

Continue reading<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-43","post","type-post","status-publish","format-standard","hentry","category-uncategorized","item-wrap"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pciGs2-H","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/43","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":1,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/posts\/43\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/madhurendra.com\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}