// ==UserScript== // @name Steam Extra Game Links // @namespace http://greasyfork.org/users/2240-doodles // @author Doodles // @version 5 // @description Adds extra links to Steam Store and Game Hub pages. // @icon http://i.imgur.com/ocF36Q0.png // @icon64 http://i.imgur.com/zK9Apns.png // @include *://steamcommunity.com/app/* // @include *://store.steampowered.com/app/* // @grant none // @updateVersion 5 // @downloadURL none // ==/UserScript== var $, jQuery; $ = jQuery = window.jQuery; function urlContains(urlfragment) { return document.URL.indexOf(urlfragment) != -1; } $("").prop("type", "text/css").html("\ div.sel_links {background:linear-gradient(to right, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.5) 100%) repeat scroll 0% 0% transparent;padding:2px 5px 2px 5px;margin-bottom:10px;font-size:10px;text-align:left;color:#888888;}\ div.sel_links a, div.sel_links a:link {color:#5491cf;text-decoration:none;}\ div.sel_links a:visited {color:#5491cf;}\ div.sel_links a:hover {color:#bbbbbb;}\ div.sel_links a:active {color:#5491cf;}\ div.sel_links hr {border:0;height:1px;background:#0a0a0a;margin-top:2px;margin-bottom:2px;}\ div.sel_foot {margin:0;padding:0;text-align:center;font-size:10px;color:#444444;}\ div.sel_foot a, div.sel_foot a:link {color:#444444;text-decoration:none;}\ div.sel_foot a:visited {color:#444444;}\ div.sel_foot a:hover {color:#bbbbbb;text-decoration:underline;}\ div.sel_foot a:active {color:#444444;}\ div.sel_float {float:right;display:block;width:200px;}").appendTo("head"); var gameId = document.URL.split("/app/")[1].split("/")[0].split("?")[0].split("#")[0]; var appName; var appNameDiv = $(".apphub_AppName").first(); if(appNameDiv.length != 0) { appName = $(appNameDiv).text(); } var link_01_01 = "AchievementStats.com"; var link_01_02 = "AStats.nl"; var link_01_03 = "HowLongToBeat.com"; var link_01_04 = "Steam Card Exchange"; var link_01_05 = "Steam Market"; var link_01_06 = "Steam Card Exchange (?)"; var link_02_01 = "SteamCharts.com"; var link_02_02 = "SteamGraph.net"; var link_02_03 = "SteamDB.info"; var link_02_04 = "PC Gaming Wiki"; var link_03_01 = "Steam Stats and Achievements"; var link_03_02 = "Official Steam Group"; var link_03_03 = "Steam Store"; var link_03_04 = "DLC (?)"; var link_03_05 = "IsThereAnyDeal.com"; var link_04_01 = "Steam Hub"; var link_04_02 = "Discussions"; var link_04_03 = "Screenshots"; var link_04_04 = "Artwork"; var link_04_05 = "Videos"; var link_04_06 = "News"; var link_04_07 = "Announcements"; var link_04_08 = "Guides"; var link_04_09 = "Reviews"; var link_foot_1 = "GreasyFork"; var link_foot_2 = "DoodlesStuff"; if (urlContains("store.steampowered.com/app/")) { // STORE PAGE - START var linkDiv = $("
").addClass("sel_links"); var rightBox = $(".game_meta_data"); if (rightBox.length != 0) { $(rightBox).prepend(linkDiv); } var achDiv = $("#achievement_block"); if(achDiv.length != 0) { var achLinkText = "Achievements"; var achP = $(achDiv).find(".block_title").first(); if(achP.length != 0) { var numText = $(achP).text(); var numBer = numText.split(" "); if(numBer.length > 1) { achLinkText = numBer[1] + " Achievements"; } } linkDiv.append($("
"+ achLinkText +"
")); } else { linkDiv.append($("
No achievements
")); } linkDiv.append($("
" + link_01_01 + " | " + link_01_02 + "
")); var catDiv = $("#category_block"); var cardFound = false; if(catDiv.length != 0) { var catA = $(catDiv).find("a"); for (i = 0; i < catA.length; i++) { if($(catA[i]).attr('href').indexOf("search/?category2=29") > -1) { linkDiv.append($("
" + link_01_04 + " | " + link_01_05 + "
")); var cardFound = true; break; } } } if(!cardFound) { linkDiv.append($("
No Trading Cards
")); } linkDiv.append($("
" + link_03_05 + " | " + link_01_03 + "
")); var dlcBox = $(".game_area_dlc_section").first(); if (dlcBox.length != 0) { var dlcLab = "DLC (?)"; var dlcSubBox = $(dlcBox).find(".tableView").first(); if(dlcSubBox.length != 0) { var dlcA = $(dlcSubBox).find("a"); if(dlcA.length > 1) { dlcLab = "DLC (" + (dlcA.length - 1) + ")"; } } linkDiv.append($("" + dlcLab + "")); } linkDiv.append($("
")); linkDiv.append($("
" + link_02_01 + "
" + link_02_02 + "
" + link_02_03 + "
" + link_02_04 + "
")); linkDiv.append($("
")); linkDiv.append($("
" + link_04_01 + ": " + link_04_02 + ", " + link_04_03 + ", " + link_04_04 + ", " + link_04_05 + ", " + link_04_06 + ", " + link_04_07 + ", " + link_04_08 + ", " + link_04_09 + "
")); linkDiv.append($("
")); linkDiv.append($("
" + link_03_01 + "
" + link_03_02 + "
")); linkDiv.append($("
")); linkDiv.append($("
Steam Extra Links: " + link_foot_1 + " | " + link_foot_2 + "
")); // STORE PAGE - END } else if (urlContains("steamcommunity.com/app/")) { // HUB PAGE - START var linkDiv = $("
").addClass("sel_links"); var topBox = $(".apphub_sectionTabsHR").first(); if (topBox.length != 0) { $(linkDiv).insertAfter(topBox); linkDiv.append($("
Steam Extra Links:
" + link_foot_1 + " | " + link_foot_2 + "
")); linkDiv.append($("
" + link_01_01 + " | " + link_01_02 + " | " + link_01_03 + " | " + link_02_01 + " | " + link_02_02 + " | " + link_02_03 + " | " + link_02_04 + "
")); linkDiv.append($("
")); linkDiv.append($("
" + link_03_03 + " | " + link_03_04 + " | " + link_01_06 + " | " + link_03_05 + " | " + link_03_01 + " | " + link_03_02 + "
")); } // HUB PAGE - END }