// ==UserScript== // @name Steam: AStats game info // @description Add time to beat info and players rating form AStats.nl to Steam store pages. // @author Xeloses // @version 1.0.1 // @license GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) // @namespace Xeloses.Steam.AStats // @match https://store.steampowered.com/app/* // @updateURL https://raw.githubusercontent.com/Xeloses/steam-astats-info/master/steam-astats-info.user.js // @downloadURL https://raw.githubusercontent.com/Xeloses/steam-astats-info/master/steam-astats-info.user.js // @grant GM_xmlhttpRequest // @grant GM.xmlhttpRequest // @connect astats.astats.nl // @noframes // @run-at document-end // ==/UserScript== (function(){ 'use strict'; /* globals $J */ // check jQuery: if(typeof $J !== 'function') return; /* * @const AStats game info URL */ const ASTATS_URL = 'https://astats.astats.nl/astats/Steam_Game_Info.php?AppID='; /* * @class Log */ class XelLog{constructor(){let d=GM_info.script;this.author=d.author;this.app=d.name;this.ns=d.namespace;this.version=d.version;this.h='color:#c5c;font-weight:bold;';this.t='color:#ddd;font-weight:normal;';}log(s){console.log('%c['+this.app+']%c '+s,this.h,this.t)}info(s){console.info('%c['+this.app+']%c '+s,this.h,this.t+'font-style:italic;')}warn(s){console.warn('%c['+this.app+']%c '+s,this.h,this.t)}error(s){console.error('%c['+this.app+']%c '+s,this.h,this.t)}dump(v){console.log(v)}} const $log = new XelLog(); function renderGameInfo(data,game_id){ if(data.rating || data.achievements || data.time_to_beat.storyline || data.time_to_beat.fullgame || data.time_to_beat.complete){ // HTML with game info: let astatsData = '