dataset-vinmonopolet
Advanced tools
Comparing version
// Modules and stuff required | ||
const gsheets = require('gsheets') | ||
const fs = require('fs-extra') | ||
const JSONStream = require('JSONStream') | ||
const file = 'dataset-vinmonopolet.str' | ||
const gsheetsKey = '15htqMLMdbxi4csfmOyR1r6aMfZO2R2bOBacS834kfvU'// Gsheet's key to csv-products file converted to Gsheet | ||
const gsheetsWorksheet = 'test' // 'products' (all), 'redwine', 'whitewine', 'sparkling' and 'test' available so far | ||
const gsheetsWorksheet = 'products' // 'products' (all), 'redwine', 'whitewine', 'sparkling' and 'test' available so far | ||
const columns = ['Varenummer','Varenavn','Volum','Pris','Literpris','Varetype','Farge','Lukt','Smak','Land','Distsrikt','Underdistrikt','Argang','Rastoff','Alkohol'] | ||
@@ -20,6 +19,5 @@ | ||
wine = {} | ||
//console.log('Wine object empty? ' + JSON.stringify(wine)) | ||
for (var key in result.data[i]){ | ||
if (typeof result.data[i][key] !== 'function' && columns.indexOf(key) > -1) { | ||
// key in object exists, and matches something in columns array | ||
// key in wine object exists, && matches something in columns array | ||
// Add key/value to wine object | ||
@@ -32,5 +30,4 @@ wine[key] = result.data[i][key] | ||
output += '\n' | ||
// Push object to arrray that will be written to file (or write it directly?) | ||
} | ||
//console.log(output) | ||
// Writing output to file | ||
fs.outputFile(file, output, 'utf8', function (err) { | ||
@@ -37,0 +34,0 @@ if (err) { |
{ | ||
"name": "dataset-vinmonopolet", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Dataset for testing search engine capabilities.", | ||
"main": "dataset-vinmonopolet.str", | ||
"devDependencies": { | ||
"gsheets": "~1.2.3", | ||
"fs-extra": "~1.0.0" | ||
}, | ||
"scripts": { | ||
@@ -7,0 +11,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
4139485
02
Infinity%35
-7.89%