Skip to content

Instantly share code, notes, and snippets.

@MalikAQayum
Created July 18, 2019 07:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save MalikAQayum/4ac5cdd4bd94afc27a0c88a3dbbd37cd to your computer and use it in GitHub Desktop.
Checks if you have a gift of the sub / app store page you are on. (colors the title yellow)
// ==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