topyk / SNOW - PA.Tgr

// ==UserScript==
// @name         SNOW - PA.Tgr
// @namespace    https://github.com/topyk27/snow
// @updateURL    https://openuserjs.org/meta/topyk/SNOW_-_PA.Tgr.meta.js
// @downloadURL  https://openuserjs.org/install/topyk/SNOW_-_PA.Tgr.user.js
// @version      0.6
// @description  Kirim pesan WA
// @author       Topyk
// @match http://web.whatsapp.com/*
// @match https://web.whatsapp.com/*
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @grant        GM_xmlhttpRequest
// @license MIT
// ==/UserScript==

(function () {
  console.log("gasken");
  setTimeout(function () {
    console.log("mau klik");
    try {
      document.getElementsByClassName('epia9gcq')[0].click();
      GM_xmlhttpRequest({
        method: "POST",
        url: "http://192.168.2.182/snow/waku/statusPesan/ok",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        onload: function (respon) {
          console.log(respon);
        }
      });
    }
    catch (Exception) {
      console.log(Exception);
      GM_xmlhttpRequest({
        method: "POST",
        url: "http://192.168.2.182/snow/waku/statusPesan/error",
        headers: {
          "Content-Type": "application/x-www-form-urlencoded"
        },
        onload: function (respon) {
          console.log(respon);
          window.close();
        }
      });
    }
    setTimeout(function () {
      window.close();
    }, 2000);
  }, (Math.floor(Math.random() * (45 - 35)) + 35) * 1000);
})();