Steam Store - Game Owned Checker

Check all steam store game links if it's owned

Versión del día 8/4/2017. Echa un vistazo a la versión más reciente.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Necesitarás instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Necesitará instalar una extensión como Tampermonkey para instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión como Stylus para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

Necesitará instalar una extensión del gestor de estilos de usuario para instalar este estilo.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name         Steam Store - Game Owned Checker
// @icon         http://store.steampowered.com/favicon.ico
// @namespace    Royalgamer06
// @version      1.2
// @description  Check all steam store game links if it's owned
// @author       Royalgamer06
// @include      /^https?\:\/\/.+/
// @exclude      /^https?\:\/\/.+\.steampowered\.com.*$/
// @grant        GM_xmlhttpRequest
// @grant        GM_openInTab
// @grant        GM_info
// @run-at       document-idle
// @connect      store.steampowered.com
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
// ==/UserScript==

const prefix = false; //prefix (true) instead of suffix (false) position icon ❤/✔/✖

GM_xmlhttpRequest({
    method: "GET",
    url: "http://store.steampowered.com/dynamicstore/userdata/",
    onload: function(response) {
        var json = JSON.parse(response.responseText);
        var ownedApps = json.rgOwnedApps;
        var ownedPackages = json.rgOwnedPackages;
        var wishlist = json.rgWishlist;
        if (ownedApps.length === 0 && ownedPackages.length === 0 && wishlist.length === 0 && !GM_info.isPrivate) {
            if (confirm("Userscript '" + GM_info.script.name + "' did not work properly: Could not get user data.\nPlease make sure you are logged in to the Steam Store and dynamic store userdata is loaded.\nLogin first, then keep refreshing the dynamic store userdata page untill the data is loaded.\nDo you want to attempt to fix this now?")) {
                GM_openInTab("http://store.steampowered.com/dynamicstore/userdata/", false);
                GM_openInTab("http://store.steampowered.com/login/", false);
            } else {
                alert("Please disable the userscript 'Steam Store - Game Owned Checker' to stop receiving these popup's.");
            }
        } else {
            $("a[href*='//store.steampowered.com/app/'], a[href*='//store.steampowered.com/agecheck/app/']").each(function() {
                var appID = parseInt(this.href.split("app/")[1].split("/")[0].split("?")[0].split("#")[0]);
                if ($.inArray(appID, ownedApps) > -1) { //if owned
                    $(this).html(prefix ? "<span style='color: green;'>&#10004; </span>" + $(this).html() : $(this).html() + "<span style='color: green;'> &#10004;</span>"); //✔
                } else { //else not owned
                    if ($.inArray(appID, wishlist) > -1) { //if wishlisted
                        $(this).html(prefix ? "<span style='color: HotPink;'>&#10084; </span>" + $(this).html() : $(this).html() + "<span style='color: HotPink;'> &#10084;</span>"); //❤
                    } else { //else not wishlisted
                        $(this).html(prefix ? "<span style='color: red;'>&#10006; </span>" + $(this).html() : $(this).html() + "<span style='color: red;'> &#10006;</span>"); //✖
                    }
                }
            });
            $("a[href*='//store.steampowered.com/sub/']").each(function() {
                var subID = parseInt(this.href.split("sub/")[1].split("/")[0].split("?")[0].split("#")[0]);
                if ($.inArray(subID, ownedPackages) > -1) { //if owned
                    $(this).html(prefix ? "<span style='color: green;'>&#10004; </span>" + $(this).html() : $(this).html() + "<span style='color: green;'> &#10004;</span>"); //✔
                } else { //else not owned
                    $(this).html(prefix ? "<span style='color: red;'>&#10006; </span>" + $(this).html() : $(this).html() + "<span style='color: red;'> &#10006;</span>"); //✖
                }
            });
        }
    }
});