{"id":486,"date":"2020-07-05T13:07:55","date_gmt":"2020-07-05T09:07:55","guid":{"rendered":"http:\/\/elhana.ru\/?p=486"},"modified":"2020-07-05T17:31:12","modified_gmt":"2020-07-05T13:31:12","slug":"whatsapp-online-tracking","status":"publish","type":"post","link":"https:\/\/elhana.ru\/?p=486","title":{"rendered":"Whatsapp online tracking"},"content":{"rendered":"\n<p>Simple devtools script to track when User is coming online\/offline with privacy options on (whatsapp is not showing last seen)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>function getElementByXpath(path) {<\/em>\n<em>   return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;<\/em>\n<em> }<\/em>\n<em> var online = false;<\/em>\n<em> setInterval(function() {<\/em>\n<em>  if (getElementByXpath('\/\/*[@id=\"main\"]\/header\/div[2]\/div[1]\/div\/span').textContent == \"User to track\") {   var lastSeen = getElementByXpath('\/\/*[@id=\"main\"]\/header\/div[2]\/div[2]\/span');<\/em>\n<em>   if (lastSeen != null) {<\/em>\n<em>     var today = new Date();<\/em>\n<em>     var time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();<\/em>\n<em>     var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();<\/em>\n<em>       console.log(date + \" \"+ time + \", \" + lastSeen.textContent);<\/em>\n<em>     if (online == false) {<\/em>\n<em>         new Notification(date + \" \"+ time + \", \" + lastSeen.textContent);<\/em>\n<em>         online = true;<\/em>\n<em>     }<\/em>\n<em>   } else {<\/em>\n<em>      if (online == true) {<\/em>\n<em>         var today = new Date();<\/em>\n<em>         var time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();<\/em>\n<em>         var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();<\/em>\n<em>         new Notification(date + \" \"+ time + \" Offline\");<\/em>\n<em>         online = false;<\/em>\n<em>     }<\/em>\n<em>   }<\/em>\n<em>  }<\/em>\n<em> }, 1000);<\/em> <\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Simple devtools script to track when User is coming online\/offline with privacy options on (whatsapp is not showing last seen) function getElementByXpath(path) { return document.evaluate(path, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } var online = false; setInterval(function() { if (getElementByXpath(&#8216;\/\/*[@id=&#8221;main&#8221;]\/header\/div[2]\/div[1]\/div\/span&#8217;).textContent == &#8220;User &hellip; <a href=\"https:\/\/elhana.ru\/?p=486\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-486","post","type-post","status-publish","format-standard","hentry","category-general"],"_links":{"self":[{"href":"https:\/\/elhana.ru\/index.php?rest_route=\/wp\/v2\/posts\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elhana.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elhana.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elhana.ru\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/elhana.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=486"}],"version-history":[{"count":3,"href":"https:\/\/elhana.ru\/index.php?rest_route=\/wp\/v2\/posts\/486\/revisions"}],"predecessor-version":[{"id":489,"href":"https:\/\/elhana.ru\/index.php?rest_route=\/wp\/v2\/posts\/486\/revisions\/489"}],"wp:attachment":[{"href":"https:\/\/elhana.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elhana.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elhana.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}