Skip to content

Instantly share code, notes, and snippets.

@ErykDarnowski
Last active December 5, 2023 18:00
Show Gist options
  • Save ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05 to your computer and use it in GitHub Desktop.
Save ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05 to your computer and use it in GitHub Desktop.
GOG % rating converter [Userscript]

GOG % rating converter [Userscript]

A script that converts gog.com ratings from: 4.5 / 5 to: 90%.

Instructions

  1. Install a Userscript browser extension

*It should work fine with most extensions (if not, write a comment)
2. Add the script

Tampermonkey
  1. Click on the extension icon (in the top right corner of the browser - you may have to click the puzzle icon first to see it)
  2. Click Control panel
  3. Click Utilities
  4. At the bottom in to Import from URL paste in this URL: https://gist.githubusercontent.com/ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05/raw/4777e917e3fc47e8aa8619bf5ec74927f998b55b/userscript.js
  5. Click Install
  6. Click Install again
Violentmonkey
  1. Click on the extension icon (in the top right corner of the browser - you may have to click the puzzle icon first to see it)
  2. Click the cog icon
  3. Click +
  4. Click Install from URL
  5. Paste in this URL: https://gist.githubusercontent.com/ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05/raw/9f512144e028f62bdb64a558fe95e9f3565d09f6/userscript.js
  6. Click Confirm
  7. Click Close

*The script should auto update!
*Remember, you can turn the script ON / OFF whenever you like by just flipping the switch next to it's name

// ==UserScript==
// @name GOG % rating converter
// @description A script that converts gog.com ratings from: `4.5 / 5` to: `90%`.
// @version 1.0.1
// @author Eryk Darnowski (GH: ErykDarnowski TW: @erykdarnowski)
// @match *://www.gog.com/*game/*
// @run-at document-end
// @grant none
// @namespace https://gist.github.com/ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05
// @supportURL https://gist.github.com/ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05
// @updateURL https://gist.githubusercontent.com/ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05/raw/4777e917e3fc47e8aa8619bf5ec74927f998b55b/userscript.js
// @downloadURL https://gist.githubusercontent.com/ErykDarnowski/3c8637ab442ae15d3d76b6fee4dc4f05/raw/4777e917e3fc47e8aa8619bf5ec74927f998b55b/userscript.js
// ==/UserScript==
/* Releases
- 1.0.0 Initial
- 1.0.1 Fix `@match` not working on `/game/<name>` URLs
*/
(() => {
"use strict";
const [ratingEl] = document.getElementsByClassName("rating productcard-rating__score");
if (ratingEl) ratingEl.textContent = Math.round(parseFloat(ratingEl.textContent.split("/")[0]) * 20) + "%";
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment