Skip to content

Link Utilities: Custom link profiles

Alexander Heidn edited this page Mar 20, 2024 · 6 revisions

Overview

Using custom link profiles you can basically add other websites to be linked via Link Utilities. For that to work the website must have pages with URLs, that can be found via the game name, steam ID, GOG ID or rom name (mostly the fixed rom names MAME uses) and have no other variable parts like their own internal IDs for example. MobyGames couldn't be added that way, because they have their own ID in the URL. PCGamingWiki would work, because their URLs only use the game name as a variable part. Added websites will the appear in the "Add link" menu and will behave exactly like all other links.

Another use case for custom link profiles is to provide an easy way to search for a game on a specific site by opening the search page in a web browser. Combined with the bookmarklet function of Link Utilities you can add links to sites that won't work otherwise. The search links will then appear in the "Open browser search" menu. For each website you can add either the "Game URL", "Browser search URL" or both.

Custom link profiles unfortunately can't be used to add websites to the internal "Search link" function of Link Utilities, because that would require much more involved steps to interpret the search results, that can't be easily parameterized.

How does it work?

To add a website as a custom link profile you need to click add on the custom link profiles tab in the Link Utilities settings, then provide a name for the link to be added, the "Game URL" to the game with placeholders for the variable parts and optionally tick some of the checkboxes to modify, how the game name will be formatted and how the link will be verified. You can also provide an URL to open the search page of that website with the game name filled in. This will also work without a game URL then.

Placeholders

You can use the following placeholders in the game url:

  • {GameName} - The name of the game. This field will be formatted using the ticked checkboxes described below. Web search URLs can only use this placeholder and don't use the formatting options, but will always use "URL encode" , because that's the common way to do that in search URLs.
  • {SteamId} - Adds the steam ID to the URL. This only works for games, that were added by the Steam library addon, because we won't have access to said ID otherwise. This placeholder is useful for sites like SteamDB, that are directly tied to steam games.
  • {GogId} - Adds the GOG ID to the URL. This works the same way as the Steam ID, but for GOG instead. The placeholder likewise is only available to games added by the GOG library addon.
  • {RomName} - This placeholder only works for emulated games, that are installed and have a rom assigned. It's mostly useful for MAME based roms, because those have static names that represent the unique ID for each game and are often used on websites with info on MAME games.

Formatting options

Since you can't use every possible character in an URL, most websites use different ways to format strings to omit or mask these characters. Because of that you can combine several common techniques to format the game name added to the URL by ticking the corresponding checkboxes to fit the specific needs of each website.

  • Remove special chars - Removes all characters that aren't part of the english alphabet, a number, a whitespace or a hyphen. For example "Brütal Legend" would then become "Brtal Legend".
  • Remove hyphens - Does what it says. Will be executed before the "whitespaces to hyphens" option!
  • Remove whitespaces - Does what it says. Will be executed after the "Underscores to whitespaces" option!
  • Remove diacritics - Removes diacritics from the game name. For example "Brütal Legend" would then become "Brutal Legend".
  • Remove edition suffix - Removes stuff like "Special Edition" or HD from the end of a game name. The option looks for "edition, cut, hd, collection, remaster, remastered, remake, ultimate, anthology or "game of the" and removes that string with everything else after a hyphen or colon. "Age of Empires II: Definitive Edition" becomes "Age of Empires II" that way or "Grim Fandango Remastered" becomes "Grim Fandango". It should work with the most common cases. If something is missing, please open an issue.
  • Whitespaces to hyphens - Exchanges whitespaces with hyphens. Will be executed after the option "Remove whitespaces" and multiple whitespaces will be collapsed to only one hyphen!
  • Underscores to whitespaces - Exchanges underscores with whitespaces. Will be executed before the option "Whitespaces to underscores" and after "Remove special chars".
  • Whitespaces to underscores - Exchanges whitespaces with underscores. Will be executed after the options "Underscores to whitespaces" and "Remove special chars". Multiple whitespaces will be collapsed to only one underscore!
  • Escape datastring - Converts all characters except for RFC 2396 unreserved characters to their hexadecimal representation. For example "Baldur's Gate 3" would then become "Baldur%27s%20Gate%203".
  • URL encode - Converts characters that are not allowed in a URL into character-entity equivalents. This is very similar to "Escape datastring", but some characters behave differently. For example "Url encode" replaces whitespaces with a plus sign, while "Escape datastring" uses "%20". "Baldur's Gate 3" would then become "Baldur%27s+Gate+3".
  • To lowercase - Converts all uppercase characters to lowercase.
  • To TitleCase - Changes a game name so every word will begin with a capital letter.

Depending on the website, you'll need to combine these options to generate the desired link. There's a text box on the bottom of the settings tag to test the settings out. If an URL doesn't contain the game name, you don't need to tick any of these boxes.

Verifying options

To verify, if a link really exists on the website, Link Utilities will try to reach that URL and process the return value. Unfortunately not all websites simply return the "OK" code if the URL is valid or sometimes do that, despite redirecting to the home page for example. Because of that you have some options to adapt to the behavior of said websites.

  • Allow redirects - The link will be considered valid, even if the website redirects to another page (or at least sends a redirect signal).
  • Returns the same URL - The link will only be considered valid, if the website returns exactly the same url and doesn't change it.
  • Needs to be checked - When unticked, the link won't be checked and always counts as valid. This is only useful for sites, where you can be sure, that the URL exists. SteamDB is a good example, because it has links for all steam games via the steam ID.