afr / reporting-oso-onedigit

// ==UserScript==
// @name         reporting-oso-onedigit
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  try to take over the world!
// @author       afr
// @match        https://onedigit.telkom.co.id/tikettracking
// @icon         https://www.google.com/s2/favicons?domain=co.id
// @updateURL    https://openuserjs.org/meta/afr/reporting-oso-onedigit.meta.js
// @downloadURL  https://openuserjs.org/install/afr/reporting-oso-onedigit.user.js
// @grant        none
// @copyright    2021
// @license      MIT
// ==/UserScript==

(function () {
  'use strict';

  function getData() {
    document.querySelectorAll('.ui-multiselect-all')[3].click()
    document.querySelectorAll('.ui-multiselect-all')[4].click()
    document.querySelector('#cari').click()
    setTimeout(() => {
      document.querySelector('#exportToDetail').click()
      setTimeout(() => {
        location.reload()
      }, 1000)
    }, 2500)
  }

  // report with alt+r
  var map = []
  onkeydown = onkeyup = function (e) {
    e = e || Event
    map[e.key] = e.type === 'keydown'
    if (map['Alt'] && map['r']) {
      getData()
    }
  }

})();