gs lister

 avatar
unknown
javascript
3 years ago
2.3 kB
39
Indexable
// ==UserScript==
// @name         GS lister
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Quick Lister for GameStop NFTs
// @author       Lvl5Mage
// @match        https://nft.gamestop.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=gamestop.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const listPrice = 0.03;  // EDIT THIS VALUE. This is the list price in ETH.

    document.addEventListener('keydown', function (a) {
        if(a.which === 82){
           getShortcut();
        }
    }, false);

    const getShortcut = () => {
        var nfts = document.getElementsByClassName('kHUOdn');
        for(let i=0;i<nfts.length;i++){
            const newButton = document.createElement("button");
            const item = nfts[i];
            newButton.innerText = "LIST ME";
            newButton.style = "position:absolute;z-index:999;background: #68d6c4;border: 1px solid black;width: 100%;bottom: -10px;padding: 5px;";
            item.appendChild(newButton)

            newButton.addEventListener('click', function () {
                item.querySelector('.iLNsBJ').click();//menu
                item.querySelector('.kTkdkW').click();//manage btn

                setTimeout(function(){
                    const sidebar = document.getElementsByClassName('bDwwED')[0];
                    sidebar.querySelector('.sc-dkPtRN').click();//manage dropdown
                    document.querySelector('[aria-label="List for sale"]').click();//list4sale

                    setTimeout(function(){
                        const priceInput = document.getElementById('Set Price');
                        let input = priceInput;
                        let lastValue = input.value;
                        input.value = listPrice;
                        let event = new Event('input', { bubbles: true });
                        event.simulated = true;
                        let tracker = input._valueTracker;
                        if (tracker) {
                            tracker.setValue(lastValue);
                        }
                        input.dispatchEvent(event);
                    },200)

                },200);

            });

        };
    };
})();
Editor is loading...