Groupees - Exporter

Export steam keys and mark them as used

2017-02-10 기준 버전입니다. 최신 버전을 확인하세요.

// ==UserScript==
// @name         Groupees - Exporter
// @icon         https://groupees.com/favicon.ico
// @namespace    Royalgamer06
// @author       Royalgamer06
// @version      1.0.0
// @description  Export steam keys and mark them as used
// @include      https://groupees.com/purchases
// @grant        unsafeWindow
// @run-at       document-idle
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
$(".pre-nav").append('<button style="float:right;" onclick="exportUnused()">Export unused</button>');
unsafeWindow.exportUnused = function() {
    var win = window.open("", "", "width=480,height=640");
    $(".code:not([disabled])").each(function() {
        $(this).parents(".product").find(".usage").click();
        win.document.write($(this).parents(".product").find("h3").text() + "<br>" + $(this).val() + "<br><br>");
    });
    var range = win.document.createRange();
    range.selectNodeContents(win.document.body);
    var selection = win.window.getSelection();
    selection.removeAllRanges();
    selection.addRange(range);
};