Simple node.JS script to fetch a random game from RAWG.io API or IGDB.com
IGDB.com is given priority as it has more relevant games for the most part. However RAWG will pop up too for the more obscure games. Make sure you have NodeJS installed.
To start getting random games, do the following:
- Run
npm install axios
- Run
npm install open
- Run
npm install weighted-random
- Sign up for a Twitch account if you do not already have one, otherwise, login.
- Enable Two Factor auth on your Twitch account.
- Register an application for your gamepicker app.
- OAuth Redirect URLs can just be http://localhost.
- Category can be
Application Integration
- Once registered, manage your application you just created
- Generate a Client Secret.
- Open
gamepicker.bat
and change the linecd [YOUR_PATH_HERE]
to reflect the directory where the folder was cloned to. (This is useful because you can move the batch file elsewhere, and create shortcuts to run the batch file) - Open
gamepicker.js
and change the constantstwitchClientID
andtwitchClientSecret
to reflect the client ID and the client secret you generated. These can both be found on the screen that you generated the secret on in Step 9. - Run
node gamepicker.js
Your default browser will automatically open to the page on either IGDB or RAWG.io for the game that was selected! Have fun gaming!!