// ==UserScript== // @name Steam Extra Profile Links // @namespace http://greasyfork.org/users/2240-doodles // @author Doodles // @version 12 // @description Adds extra links to Steam Profile pages. // @icon http://i.imgur.com/c4qvWvz.png // @icon64 http://i.imgur.com/ZumqrhD.png // @include *://steamcommunity.com/id/* // @include *://steamcommunity.com/profiles/* // @include *://steamcommunity.com//id/* // @include *://steamcommunity.com//profiles/* // @exclude *://steamcommunity.com/id/*/tradeoffers/* // @exclude *://steamcommunity.com/profiles/*/tradeoffers/* // @exclude *://steamcommunity.com//id/*/tradeoffers/* // @exclude *://steamcommunity.com//profiles/*/tradeoffers/* // @grant none // @updateVersion 12 // @downloadURL none // ==/UserScript== var $, jQuery; $ = jQuery = window.jQuery; //this.$ = this.jQuery = jQuery.noConflict(true); $(document).ready(function () { 'use strict'; $.extend({ getSteamId: function(steamXmlUrl) { var theResponse = null; $.ajax({ url: steamXmlUrl, type: "GET", dataType: "xml", async: false, success: function(respText) { theResponse = respText; }, error: function(xhr, status, error) { console.log(xhr.responseText); } }); return theResponse; } }); $("").prop("type", "text/css").html('div.sel_links {background-color:#202020;padding:2px 5px 2px 5px;margin-bottom:10px;margin-right:10px;font-size:10px;color:#999999;}div.sel_links a, di' + 'v.sel_links a:link {color:#5491cf;text-decoration:none;}div.sel_links a:visited {color:#5491cf;}div.sel_links a:hover {color:#5491cf;text-decoration:u' + 'nderline;}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_fo' + 'ot {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.se' + 'l_foot a:visited {color:#444444;}div.sel_foot a:hover {color:#999999;text-decoration:underline;}div.sel_foot a:active {color:#444444;}span.selG {color' + ':#2d8d2b;}span.selY {color:#e1bf00;}span.selR {color:#a94847;}').appendTo("head"); //var profileRightColumn = $(".profile_rightcol").first(); if ($(".profile_rightcol").length) { if(document.URL.indexOf("steamcommunity.com/id/") != -1 || document.URL.indexOf("steamcommunity.com//id/") != -1) { var xmlPage = $.getSteamId("http://steamcommunity.com/id/" + document.URL.split("/id/")[1].split("/")[0].split("?")[0] + "?xml=1"); var selProfileSid64 = $(xmlPage).find("steamID64").first().text(); } else { var selProfileSid64 = document.URL.split("/profiles/")[1].split("/")[0].split("?")[0]; var xmlPage = $.getSteamId("http://steamcommunity.com/profiles/" + selProfileSid64 + "?xml=1"); } if(selProfileSid64.length == 17) { // only start IF selProfileSid64 obtained AND right column found var selTempNum = selProfileSid64.substring(5) - 197960265728; //76561197960265728; var selProfileSid32 = "STEAM_0:" + selTempNum%2 + ":" +(selTempNum - selTempNum%2) / 2; var selProfileSidV3 = "[U:1:" + selTempNum + "]"; // Prepare Box --------------------------------------------- var linkDiv = $(''); if ($(".profile_badges").length) { $(linkDiv).insertBefore($(".profile_badges").first()); if ($(".profile_in_game").length) { $(".profile_in_game").first().css("margin-bottom", "10px"); } if ($(".profile_ban_status").length) { $(".profile_ban_status").first().css("margin-bottom", "10px"); } } else { $(".profile_rightcol").first().prepend(linkDiv); } // - START --------------------------------------------------- var link_01_01 = "SteamRep"; var link_01_02 = "SteamDB"; var link_01_03 = "Steam Trades"; var link_01_04 = "Steam Gifts"; var link_01_05 = "Vac-Ban.com"; var link_02_01 = "Backpack"; var link_02_02 = "Profile"; var link_02_03 = "Backpack"; var link_02_04 = "Profile"; var link_02_05 = "Backpack"; var link_02_06 = "Profile"; var link_02_07 = "TF2 Trading Post Profile"; var link_02_08 = "TF2 Backpack Examiner"; var link_02_09 = "TF2"; var link_02_10 = "DOTA2"; var link_02_11 = "CSGO"; var link_02_12 = "Portal 2"; var link_02_13 = "TF2Center"; var link_03_01 = "Achievement Stats"; var link_03_02 = "astats.nl"; var link_03_03 = "Steam Ladder"; var link_04_01 = "Games"; var link_04_02 = "All Games"; var link_04_03 = "Screenshots"; var link_04_04 = "Videos"; var link_04_05 = "Artwork"; var link_04_06 = "Reviews"; var link_04_07 = "Guides"; var link_04_08 = "Workshop Items"; var link_04_09 = "Greenlight Items"; var link_04_10 = "Friends"; var link_04_11 = "Groups"; var link_04_12 = "TF2"; var link_04_13 = "Dota2"; var link_04_14 = "Steam"; var link_04_15 = "CSGO"; var link_04_16 = "All Comments"; var link_04_17 = "Name History"; var link_04_18 = "Friends in Common"; var link_04_19 = "Groups in Common"; var link_04_20 = "Badges"; var link_04_21 = "Wishlist"; var link_05_01 = "CSGO Lounge"; var link_foot_1 = "GreasyFork"; var link_foot_2 = "DoodlesStuff"; // Alter Profile Links --------------------------------------------- var invCount = "Inventory: "; if($(".profile_item_links").length) { $(".profile_item_links a").each(function(){ if($(this).find(".profile_count_link_total").length) { var tempHref = $(this).attr('href'); var tempCount = $(this).find(".profile_count_link_total").text().trim(); if(tempCount.length != 0) { if (tempHref.indexOf("/games/") != -1) { link_04_01 = link_04_01.replace("", " (" + tempCount + ")"); } else if (tempHref.indexOf("/screenshots/") != -1) { link_04_03 = link_04_03.replace("", " (" + tempCount + ")"); } else if (tempHref.indexOf("/videos/") != -1) { link_04_04 = link_04_04.replace("", " (" + tempCount + ")"); } else if (tempHref.indexOf("/inventory/") != -1) { invCount = "Inventory (" + tempCount + "): "; } else if (tempHref.indexOf("/myworkshopfiles/?section=greenlight") != -1) { link_04_09 = link_04_09.replace("", " (" + tempCount + ")"); } else if (tempHref.indexOf("/images/") != -1) { link_04_05 = link_04_05.replace("", " (" + tempCount + ")"); } else if (tempHref.indexOf("/myworkshopfiles/?section=guides") != -1) { link_04_07 = link_04_07.replace("", " (" + tempCount + ")"); } else if (tempHref.indexOf("/recommended/") != -1) { link_04_06 = link_04_06.replace("", " (" + tempCount + ")"); } else if (tempHref.indexOf("/myworkshopfiles/") != -1) { link_04_08 = link_04_08.replace("", " (" + tempCount + ")"); } } } }); $(".profile_item_links").first().empty(); } // Add Links --------------------------------------------- linkDiv.append($("
" + link_01_01 + " | " + link_01_02 + " | " + link_01_05 + "
")); var vac = $(xmlPage).find("vacBanned").first().text(); if(vac == "1") { vac = "VAC Banned"; } else if(vac == "0") { vac = "None"; } else { vac = "" + vac + ""; } linkDiv.append($("
VAC Ban: " + vac + "
")); var trade = $(xmlPage).find("tradeBanState").first().text(); if(trade == "None") { trade = "None"; } else { trade = "" + trade + ""; } linkDiv.append($("
Trade Ban: " + trade + "
")); var memberSince = $(xmlPage).find("memberSince").first(); if(memberSince.length != 0) { linkDiv.append($("
Joined: " + $(memberSince).text() + "
")); } linkDiv.append($("
" + selProfileSid64 + "
" + selProfileSidV3 + "
" + selProfileSid32 + "
")); linkDiv.append($("
")); linkDiv.append($("
backpack.tf: " + link_02_01 + " | " + link_02_02 +"
")); linkDiv.append($("
TF2Outpost: " + link_02_03 + " | " + link_02_04 + "
")); linkDiv.append($("
bazaar.tf: " + link_02_05 + " | " + link_02_06 + "
")); linkDiv.append($("
" + link_02_07 + "
" + link_02_08 + "
")); linkDiv.append($("
TF2B: " + link_02_09 + " | " + link_02_10 + " | " + link_02_11 + " | " + link_02_12 + "
")); linkDiv.append($("
" + link_01_03 + " | " + link_01_04 + "
")); linkDiv.append($("
" + link_02_13 + " | " + link_05_01 + "
")); linkDiv.append($("
")); linkDiv.append($("
" + link_03_01 + " | " + link_03_02 + " | " + link_03_03 + "
")); linkDiv.append($("
")); if($(".profile_private_info").length == 0) { // display profile type links IF profile ISNT private linkDiv.append($("
" + link_04_01 + " | " + link_04_02 + " | " + link_04_21 + "
")); linkDiv.append($("
" + link_04_03 + " | " + link_04_04 + " | " + link_04_05 + "
")); linkDiv.append($("
" + link_04_06 + " | " + link_04_07 + "
")); linkDiv.append($("
" + link_04_08 + " | " + link_04_09 + "
")); linkDiv.append($("
" + link_04_10 + " | " + link_04_11 + " | " + link_04_20 + "
")); linkDiv.append($("
" + invCount + link_04_12 + " | " + link_04_13 + " | " + link_04_14 + " | " + link_04_15 + "
")); linkDiv.append($("
" + link_04_16 + " | " + link_04_17 + "
")); if($("#account_pulldown").length != 0) { linkDiv.append($("
" + link_04_18 + " | " + link_04_19 + "
")); } } else { linkDiv.append($("
" + link_04_16 + " | " + link_04_17 + "
")); } linkDiv.append($("
")); linkDiv.append($("
Steam Extra Links: " + link_foot_1 + " | " + link_foot_2 + "
")); // Currently in Game - Link if($(".profile_in_game_name").length) { var gameName = $(".profile_in_game_name").text().trim(); gameName = gameName.replace("=", "%3D").replace("=", "%3D").replace("=", "%3D"); gameName = gameName.replace("&", "%26").replace("&", "%26").replace("&", "%26"); var gameName2 = gameName; while(gameName2.indexOf(" ") != -1){ gameName2 = gameName2.replace(" ", "+"); } if(gameName.indexOf("Last Online") == -1) { $(".profile_in_game_name").html($("" + gameName + "")); }else{ } } // - END ----------------------------------------------------- } } });