Skip to content

Instantly share code, notes, and snippets.

@MalikAQayum
Last active February 29, 2024 02:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MalikAQayum/11ae7ba9b7741eb9d01af883dadedca4 to your computer and use it in GitHub Desktop.
Save MalikAQayum/11ae7ba9b7741eb9d01af883dadedca4 to your computer and use it in GitHub Desktop.
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.23
// @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==
$J(function() {
const customPl = 0;
const defaultPl = 1;
const other = 1;
const trading = 1;
const statistics = 1;
const linkData = {
custom: [
{ 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: "" }
],
default: {
trading: [
{ 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: "" }
],
other: [
{ 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: [
{ 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: "" }
]
}
};
if (defaultPl === 1) {
if (trading === 1) {
appendLinks(linkData.default.trading, "#PLContainer_trading");
}
if (other === 1) {
appendLinks(linkData.default.other, "#PLContainer_other");
}
if (statistics === 1) {
appendLinks(linkData.default.statistics, "#PLContainer_statistics");
}
} else if (customPl === 1) {
appendLinks(linkData.custom, "#PLContainer_custom");
}
function appendLinks(links, containerSelector) {
const container = $J(`<div class="responsive_status_info" id="${containerSelector.replace('#', '')}"></div>`);
container.prepend(`<div class="profile_in_game persona online" id="PLContent_${containerSelector.replace('#PLContainer_', '')}" style="display: table-cell"></div>`);
$J(".profile_rightcol").prepend(container);
links.forEach(({ Sprofile, Eprofile }) => {
const link = $J(`<a href="${Sprofile + g_rgProfileData.steamid + Eprofile}" data-tooltip-html="${Sprofile.split("/")[2]}" target="_blank" id="urlFavicon"></a>`);
$J(`#PLContent_${containerSelector.replace('#PLContainer_', '')}`).append(link);
styleLink(link);
});
}
function styleLink(link) {
link.css({
"background": `url(//favicon.yandex.net/favicon/${getFavicon(link.attr('href'))})`,
"display": "block",
"float": "left",
"background-color": "transparent",
"padding": "0px",
"margin": "7px 7px",
"width": "16px",
"height": "16px"
});
}
function getFavicon(url) {
return url.match(/:\/\/(.[^/]+)/)[1];
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment