Skip to content

Instantly share code, notes, and snippets.

@vedantb vedantb/goldrushdata.js
Last active Oct 17, 2018

Embed
What would you like to do?
var data = require('./goldrushpage1.json');
var players = require('./playerOutput.json');
var fs = require('fs');
players = players || [];
var playersLength = players.length;
data.items.entities.attendee.forEach((item, index) => {
var player = item.player;
players[playersLength + index] = {
name: player.name,
twitch: player.twitchStream,
twitter: player.twitterHandle,
youtube: player.youtube,
state: player.state,
country: player.country
};
});
var json = JSON.stringify(players);
fs.writeFile('playerOutput.json', json, 'utf8', () => {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.