afr / reporting_oso_satria

// ==UserScript==
// @name         reporting_oso_satria
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  try to take over the world!
// @author       afr
// @match        https://satria.telkom.co.id/trackingtiket
// @icon         https://www.google.com/s2/favicons?domain=co.id
// @updateURL    https://openuserjs.org/meta/afr/reporting_oso_satria.meta.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()
        }
    }


})();