Nvidia geforce now browse games

Instead of using a searchbox, now you can browse the list on the page - a feature nvidia removed

  1. // ==UserScript==
  2. // @name Nvidia geforce now browse games
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Instead of using a searchbox, now you can browse the list on the page - a feature nvidia removed
  6. // @author Shr4pNull
  7. // @match https://www.nvidia.com/*/geforce-now/games/
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. var documents;
  14. var $ = window.jQuery;
  15. $.ajax({
  16. 'async': false,
  17. type: 'GET',
  18. data: "JSON",
  19. url: "https://static.nvidiagrid.net/supported-public-game-list/gfnpc.json",
  20. success: function(response){
  21. documents = response;
  22. var reg_the = /(^the )/i;
  23. var reg_a = /(^a )/i;
  24. for(var i=0; i<documents.length; i++){
  25. documents[i].title = documents[i].title.trim();
  26. if(documents[i].title.match(reg_the)){
  27. documents[i].title = documents[i].title.replace(reg_the,"") + ", The";
  28. }
  29. else if(documents[i].title.match(reg_a)){
  30. documents[i].title = documents[i].title.replace(reg_a,"") + ", A";
  31. }
  32. }
  33.  
  34. documents.sort((a,b) => (a.title.toLowerCase() > b.title.toLowerCase()) ? 1 : ((b.title.toLowerCase() > a.title.toLowerCase()) ? -1 : 0));
  35. console.log(documents);
  36. documents.forEach(function(e){
  37. var linkToSteam = e.steamUrl ? `<a href="${e.steamUrl}" target="_blank" style="font-size:80%;">[steam]</a>` : "";
  38. $(".result").append(`<div><span style="font-weight: ${e.isFullyOptimized ? "bold":"normal"}">${e.title}</span> ${linkToSteam}</div>`);
  39.  
  40. });
  41. }
  42. }); //end of $.ajax
  43.  
  44. })();