// ==UserScript== // @name Steam Extra Profile Links // @namespace http://greasyfork.org/users/2240-doodles // @author Doodles // @version 4 // @description Adds extra links to Steam Profile pages. // @icon http://i.imgur.com/9RyxVXP.png // @icon64 http://i.imgur.com/d3fMq5W.png // @include *://steamcommunity.com/id/* // @include *://steamcommunity.com/profiles/* // @exclude *://steamcommunity.com/id/*/tradeoffers/ // @exclude *://steamcommunity.com/profiles/*/tradeoffers/ // @grant none // @updateVersion 4 // @downloadURL none // ==/UserScript== var $, jQuery; $ = jQuery = window.jQuery; $.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, div.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:underline;}\ 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:#999999;text-decoration:underline;}\ div.sel_foot a:active {color:#444444;}\ span.selG {color:#016401;} span.selY {color:#e1bf00;} span.selR {color:#611515;}").appendTo("head"); // Preface Code --------------------------------------------- var profileRightColumn = $(".profile_rightcol").first(); if (profileRightColumn.length != 0) { var s64, s32, sAc, xmlPage; if(document.URL.indexOf("steamcommunity.com/id/") != -1) { xmlPage = $.getSteamId("http://steamcommunity.com/id/" + document.URL.split("/id/")[1].split("/")[0].split("?")[0] + "?xml=1"); s64 = $(xmlPage).find("steamID64").first().text(); } else { s64 = document.URL.split("/profiles/")[1].split("/")[0].split("?")[0]; xmlPage = $.getSteamId("http://steamcommunity.com/profiles/" + s64 + "?xml=1"); } if(s64.length == 17) { // only start IF s64 obtained AND right column found var num = s64.substring(5) - 197960265728; //76561197960265728; s32 = "STEAM_0:" + num%2 + ":" +(num - num%2) / 2; sAc = "[U:1:" + num + "]"; // Prepare Box --------------------------------------------- var linkDiv = $("
").addClass("sel_links"); var badgeDiv = $(".profile_badges").first(); if (badgeDiv.length != 0) { $(linkDiv).insertBefore(badgeDiv); var onlineStatus = $(".profile_in_game").first(); if (onlineStatus.length != 0) { onlineStatus.css("margin-bottom", "10px"); } var banStatus = $(".profile_ban_status").first(); if (banStatus.length != 0) { banStatus.css("margin-bottom", "10px"); } } else { profileRightColumn.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_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_03_01 = "Achievement Stats"; var link_03_02 = "astats.nl"; var link_03_03 = "Wasted on Steam"; 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_05_01 = "CSGO Lounge"; var link_foot_1 = "GreasyFork"; var link_foot_2 = "DoodlesStuff"; // Alter Profile Links --------------------------------------------- var invCount = "Inventory: "; var normalLinks = $(".profile_item_links").first(); if(normalLinks.length != 0) { var c = $(normalLinks).find("a"); for (i = 0; i < c.length; i++) { var spanCount = $(c[i]).find(".profile_count_link_total").first(); if(spanCount.length != 0) { var cv = $(spanCount).text().trim(); if(cv.length != 0) { if (c[i].href.indexOf("/games/") != -1) { link_04_01 = link_04_01.replace("", " (" + cv + ")"); } else if (c[i].href.indexOf("/screenshots/") != -1) { link_04_03 = link_04_03.replace("", " (" + cv + ")"); } else if (c[i].href.indexOf("/videos/") != -1) { link_04_04 = link_04_04.replace("", " (" + cv + ")"); } else if (c[i].href.indexOf("/inventory/") != -1) { invCount = "Inventory (" + cv + "): "; } else if (c[i].href.indexOf("/myworkshopfiles/?section=greenlight") != -1) { link_04_09 = link_04_09.replace("", " (" + cv + ")"); } else if (c[i].href.indexOf("/images/") != -1) { link_04_05 = link_04_05.replace("", " (" + cv + ")"); } else if (c[i].href.indexOf("/myworkshopfiles/?section=guides") != -1) { link_04_07 = link_04_07.replace("", " (" + cv + ")"); } else if (c[i].href.indexOf("/recommended/") != -1) { link_04_06 = link_04_06.replace("", " (" + cv + ")"); } else if (c[i].href.indexOf("/myworkshopfiles/") != -1) { link_04_08 = link_04_08.replace("", " (" + cv + ")"); } } } } normalLinks.remove(); } // Add Links --------------------------------------------- linkDiv.append($("
" + link_01_01 + " | " + link_01_02 + "
")); 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 privacy = $(xmlPage).find("privacyState").first().text(); if(privacy == "private") { privacy = "Private"; } else if(privacy == "friendsonly") { privacy = "Friends Only"; } else if(privacy == "public") { privacy = "Public"; } linkDiv.append($("
Profile Privacy: " + privacy + "
"));*/ var memberSince = $(xmlPage).find("memberSince").first(); if(memberSince.length != 0) { linkDiv.append($("
Joined: " + $(memberSince).text() + "
")); } linkDiv.append($("
" + s64 + "
" + sAc + "
" + s32 + "
")); 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 + "
" + 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 + "
")); 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 + "
")); } linkDiv.append($("
")); } linkDiv.append($("
Steam Extra Links: " + link_foot_1 + " | " + link_foot_2 + "
")); // - END ----------------------------------------------------- } }