Created
July 18, 2019 07:04
Star
You must be signed in to star a gist
Checks if you have a gift of the sub / app store page you are on. (colors the title yellow)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Inventory store checker | |
// @namespace https://gist.github.com/MalikAQayum | |
// @version 0.1 | |
// @description Checks if you have a gift of the sub / app store page you are on. (colors the title yellow) | |
// @author MalikQayum | |
// @connect store.steampowered.com | |
// @connect steamcommunity.com | |
// @include /^https?://store.steampowered.com/(app|sub)/*/ | |
// @grant GM_xmlhttpRequest | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// @grant GM_deleteValue | |
// @grant GM_addStyle | |
// ==/UserScript== | |
getData(); | |
function getData(){ | |
var AppSub = location.href.split("/")[4]; | |
var steamid = "765611"; | |
steamid += 97960265728 + g_AccountID; | |
checkInventory(AppSub,steamid); | |
} | |
function checkInventory(AppSub,steamid){ | |
GM_xmlhttpRequest({ | |
method: "GET", | |
url: "http://steamcommunity.com/inventory/"+steamid+"/753/1?l=english&count=5000", | |
onload: function(response) { | |
var inventory = response.responseText; | |
var re_str = '(app|sub)/' + AppSub + '/'; | |
var re = new RegExp(re_str); | |
var match = inventory.match(re); | |
if(match[0].includes('app')){ | |
$J("body > div.responsive_page_frame.with_header > div.responsive_page_content > div.responsive_page_template_content > div.game_page_background.game > div.page_content_ctn > div.page_title_area.game_title_area.page_content > div.apphub_HomeHeaderContent > div > div.apphub_AppName").css('color', 'yellow'); | |
} | |
if(match[0].includes('sub')){ | |
$J("body > div.responsive_page_frame.with_header > div.responsive_page_content > div.responsive_page_template_content > div.game_page_background.game > div.page_content_ctn > div > div.page_title_area.game_title_area > h2").css('color', 'yellow'); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment