IndieGala - Gift Fetch & Copy

Reveal all steam keys or gift links of the bundle and copy them all to clipboard

当前为 2017-04-16 提交的版本,查看 最新版本

// ==UserScript==
// @name         IndieGala - Gift Fetch & Copy
// @icon         https://www.indiegala.com/favicon.ico
// @namespace    Royalgamer06
// @author       Royalgamer06
// @version      1.0.1
// @description  Reveal all steam keys or gift links of the bundle and copy them all to clipboard
// @include      https://www.indiegala.com/gift?gift_id=*
// @grant        GM_setClipboard
// @grant        unsafeWindow
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
$.fn.innerText = function() {
    return $(this).contents().filter(function() {
        return this.nodeType == 3;
    }).text();
};
$(document).ready(function() {
    unsafeWindow.confirm = function() {
        return true;
    }
    $("#steam-key-games .left").append('&nbsp;&nbsp;<input type="button" class="button" value="Fetch All Steam Keys" id="fetchSteamKeys"></input>');
    $("#steam-key-games .left").append('&nbsp;&nbsp;<input type="button" class="button" value="Fetch All Gift Links" id="fetchGiftLinks"></input>');
    $("#fetchSteamKeys").click(fetchSteamKeys);
    $("#fetchGiftLinks").click(fetchGiftLinks);
});
function listSteamKeys() {
    var list = "";
    $(".game-key-string").each(function() {
        list += $(this).find(".game-steam-url").innerText().trim() + "\t" + $(this).find(".keys").val() + "\r\n";
    });
    console.log(list);
    GM_setClipboard(list);
}
function listGiftLinks() {
    var list = "";
    $(".game-key-string").each(function() {
        list += $(this).find(".game-steam-url").innerText().trim() + "\t" + $(this).find("[class*=give-gift-link] a").attr("href") + "\r\n";
    });
    console.log(list);
    GM_setClipboard(list);
}
function fetchSteamKeys() {
    $(".order-button-profile").each(function() {
        unsafeWindow.globalAjaxSemaphore = false;
        $(this).click();
    });
    $("#fetchGiftLinks").hide();
    $("#fetchSteamKeys").val("Copy All Steam Keys").click(listSteamKeys);
}
function fetchGiftLinks() {
    $("[name=steambutton]").each(function() {
        unsafeWindow.globalAjaxSemaphore = false;
        $(this).click();
    });
    $("#fetchSteamKeys").hide();
    $("#fetchGiftLinks").val("Copy All Gift Links").click(listGiftLinks);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址