Update site

This commit is contained in:
Brandon Tilley 2013-12-27 10:45:37 -08:00
parent ad4b78ecd9
commit 53b37fb20f
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,28 @@
#!/usr/bin/env node
var fs = require('fs');
var filename = process.argv[2];
if (!filename) {
console.log("Please specify a file to process");
process.exit(1);
}
if (!fs.existsSync(filename)) {
console.log("#{filename} not found.");
process.exit(2);
}
var data = fs.readFileSync(filename, 'utf8');
var json = JSON.parse(data);
var quakeData = json.features.map(function(feature) {
return {
time: feature.properties.time,
lat: feature.geometry.coordinates[1],
lng: feature.geometry.coordinates[0],
mag: feature.properties.mag
};
}).sort(function(a, b) { return a.time - b.time});
console.log(JSON.stringify(quakeData));

File diff suppressed because one or more lines are too long