Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Adds clickable icon links to external sites (steam-tracker.com, removed.timekillerz.eu, astats.nl, steamrep.com, barter.vg, backpack.tf, steamtrades, steamgifts)
// ==UserScript==
// @name Profile Linker
// @namespace https://gist.github.com/MalikAQayum/11ae7ba9b7741eb9d01af883dadedca4
// @version 1.19
// @description Adds clickable icons to external sites in the "profile_rightcol".
// @author MalikQayum
// @include /^https?:\/\/steamcommunity\.com[/]+(id|profiles)[/]+[^/]+(\/|)$/
// @downloadURL https://gist.github.com/MalikAQayum/11ae7ba9b7741eb9d01af883dadedca4/raw/ProfileLinker.user.js
// @updateURL https://gist.github.com/MalikAQayum/11ae7ba9b7741eb9d01af883dadedca4/raw/ProfileLinker.user.js
// @grant none
// ==/UserScript==
/*
*steam wont let you use http so you will need https to show the favicons, which is why TK is failing to show its favicon.
*you can change the links to other sites, you just need to make sure the site you link to supports searching with a SteamID.
* Steam Guide with a lot of sites to get inspired from, in case you want to change some links.
* https://steamcommunity.com/sharedfiles/filedetails/?id=451698754
*/
var PL_Version = GM_info.script.version, PL_Name = GM_info.script.name, PL_Author = GM_info.script.author, PL_Namespace = GM_info.script.namespace;
console.log ('%c '+PL_Name + ': v'+PL_Version + ' by '+PL_Author, 'background: grey; color: white; display: block;', PL_Namespace);
var data_custom = {
"ProfileLinks": {
"custom": {
"0": [
{
"Sprofile":"https://steamrep.com/profiles/",
"Eprofile":""
},
{
"Sprofile":"https://barter.vg/steam/",
"Eprofile":""
},
{
"Sprofile":"https://backpack.tf/profiles/",
"Eprofile":""
},
{
"Sprofile":"https://www.steamtrades.com/user/",
"Eprofile":""
},
{
"Sprofile":"https://scrap.tf/profile/",
"Eprofile":""
},
{
"Sprofile":"https://dispenser.tf/id/",
"Eprofile":""
},
{
"Sprofile":"https://csgolounge.com/profile/",
"Eprofile":""
},
{
"Sprofile":"https://dota2lounge.com/profile/",
"Eprofile":""
}
]
}
}
}
var data_default = {
"ProfileLinks": {
"other": {
"0": [
{
"Sprofile": "https://steamdb.info/calculator/",
"Eprofile": ""
},
{
"Sprofile":"https://steam.tools/itemvalue/#/",
"Eprofile":"-753"
},
{
"Sprofile":"https://csgobackpack.net/?nick=",
"Eprofile":""
},
{
"Sprofile": "https://steamladder.com/profile/",
"Eprofile": ""
},
{
"Sprofile": "https://steamid.uk/profile/",
"Eprofile": ""
},
{
"Sprofile": "http://steam-tools.net/infograph/index_userprofile.php?steamid=",
"Eprofile": ""
},
{
"Sprofile":"https://www.steamgifts.com/go/user/",
"Eprofile":""
}
]
},
"statistics": {
"0": [
{
"Sprofile":"https://steam-tracker.com/user/",
"Eprofile":""
},
{
"Sprofile":"http://removed.timekillerz.eu/tools.php?steamprofile=",
"Eprofile":""
},
{
"Sprofile":"https://astats.astats.nl/astats/User_Info.php?SteamID64=",
"Eprofile":""
},
{
"Sprofile":"https://completionist.me/steam/profile/",
"Eprofile":""
},
{
"Sprofile":"http://www.achievementstats.com/index.php?action=profile&playerId=",
"Eprofile":""
},
{
"Sprofile":"https://steamhunters.com/profiles/",
"Eprofile":"/achievements"
},
{
"Sprofile":"https://csgo-stats.com/player/",
"Eprofile":""
},
{
"Sprofile":"https://www.dotabuff.com/players/",
"Eprofile":""
}
]
},
"trading": {
"0": [
{
"Sprofile":"https://steamrep.com/profiles/",
"Eprofile":""
},
{
"Sprofile":"https://barter.vg/steam/",
"Eprofile":""
},
{
"Sprofile":"https://backpack.tf/profiles/",
"Eprofile":""
},
{
"Sprofile":"https://www.steamtrades.com/user/",
"Eprofile":""
},
{
"Sprofile":"https://scrap.tf/profile/",
"Eprofile":""
},
{
"Sprofile":"https://dispenser.tf/id/",
"Eprofile":""
},
{
"Sprofile":"https://csgolounge.com/profile/",
"Eprofile":""
},
{
"Sprofile":"https://dota2lounge.com/profile/",
"Eprofile":""
},
{
"Sprofile":"https://www.steamtradematcher.com/tools/specscan/",
"Eprofile":""
}
]
}
}
}
$J(document).ready(function() {
let custom_pl = 0;
let default_pl = 0;
//default_pl settings
let other = 0;
let trading =0;
let statistics=0;
if(default_pl === 1){
if(trading === 1){
//trading
$J(".profile_rightcol").prepend($J("<div>").attr({"class":"responsive_status_info"}).attr({"id":"PLContainer_trading"}));
$J("#PLContainer_trading").prepend($J("<div>").attr({"class":"profile_in_game persona online"}).attr({"id":"PLContent_trading"}).attr({"style":"display: table-cell"}));
for (var i = 0; i < data_default.ProfileLinks.trading[0].length; i++) {
$J("#PLContent_trading").append($J("<a>").attr({"href": data_default.ProfileLinks.trading[0][i]["Sprofile"] + g_rgProfileData.steamid + data_default.ProfileLinks.trading[0][i]["Eprofile"],"data-tooltip-html":data_default.ProfileLinks.trading[0][i]["Sprofile"].split("/")[2],"target": "_blank","id":"urlFavicon"}));
}
}
if(other === 1){
//other
$J(".profile_rightcol").prepend($J("<div>").attr({"class":"responsive_status_info"}).attr({"id":"PLContainer_other"}));
$J("#PLContainer_other").prepend($J("<div>").attr({"class":"profile_in_game persona online"}).attr({"id":"PLContent_other"}).attr({"style":"display: table-cell"}));
for (var k = 0; k < data_default.ProfileLinks.other[0].length; k++) {
$J("#PLContent_other").append($J("<a>").attr({"href": data_default.ProfileLinks.other[0][k]["Sprofile"] + g_rgProfileData.steamid + data_default.ProfileLinks.other[0][k]["Eprofile"],"data-tooltip-html":data_default.ProfileLinks.other[0][k]["Sprofile"].split("/")[2],"target": "_blank","id":"urlFavicon"}));
}
}
if(statistics === 1){
//statistics
$J(".profile_rightcol").prepend($J("<div>").attr({"class":"responsive_status_info"}).attr({"id":"PLContainer_statistics"}));
$J("#PLContainer_statistics").prepend($J("<div>").attr({"class":"profile_in_game persona online"}).attr({"id":"PLContent_statistics"}).attr({"style":"display: table-cell"}));
for (var j = 0; j < data_default.ProfileLinks.statistics[0].length; j++) {
$J("#PLContent_statistics").append($J("<a>").attr({"href": data_default.ProfileLinks.statistics[0][j]["Sprofile"] + g_rgProfileData.steamid + data_default.ProfileLinks.statistics[0][j]["Eprofile"],"data-tooltip-html":data_default.ProfileLinks.statistics[0][j]["Sprofile"].split("/")[2],"target": "_blank","id":"urlFavicon"}));
}
}
} else if(custom_pl === 1){
//custom
$J(".profile_rightcol").prepend($J("<div>").attr({"class":"responsive_status_info"}).attr({"id":"PLContainer_custom"}));
$J("#PLContainer_custom").prepend($J("<div>").attr({"class":"profile_in_game persona online"}).attr({"id":"PLContent_custom"}).attr({"style":"display: table-cell"}));
for (var h = 0; h < data_custom.ProfileLinks.custom[0].length; h++) {
$J("#PLContent_custom").append($J("<a>").attr({"href": data_custom.ProfileLinks.custom[0][h]["Sprofile"] + g_rgProfileData.steamid + data_custom.ProfileLinks.custom[0][h]["Eprofile"],"data-tooltip-html":data_custom.ProfileLinks.custom[0][h]["Sprofile"].split("/")[2],"target": "_blank","id":"urlFavicon"}));
}
} else {
//no settings set.
}
});
function getFavicon(url) {
return url.match(/:\/\/(.[^/]+)/)[1];
}
$J("a[id^='urlFavicon']").each(function() {
$J(this).css({
"background": "url(//favicon.yandex.net/favicon/" + getFavicon(this.href) + ")",
"display": "block",
"float": "left",
"background-color": "transparent",
"padding": "0px",
"margin": "7px 7px",
"width":"16px",
"height":"16px"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment