This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('then-request') | |
// This is your microsoft live account information | |
const LOGIN = process.env.LOGIN // typically an email address | |
const PASSWD = process.env.PASSWD // typically your xbox live password | |
// This is the "api" we'll be calling once we login | |
const endpoint = 'https://www.halowaypoint.com/en-us/games/halo-the-master-chief-collection/xbox-one/' + | |
'game-history?gamertags=Furiousn00b&gameVariant=all&view=DataOnly' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const crypto = require('crypto') | |
function csprng(min, max) { | |
// Some credit to https://github.com/joepie91/node-random-number-csprng | |
/* Careful! This doesn't work with large ranges. Specifically, don't use | |
* this with ranges larger than 2^32 - 1 */ | |
const range = max - min | |
if (range >= Math.pow(2, 32)) |