Skip to content

Instantly share code, notes, and snippets.

@bibliotechy
Created March 3, 2017 03:01
Show Gist options
  • Save bibliotechy/510c3482974a1827c444cd46a05a23b7 to your computer and use it in GitHub Desktop.
Save bibliotechy/510c3482974a1827c444cd46a05a23b7 to your computer and use it in GitHub Desktop.
google sheet to new line delimited json
#based on https://github.com/jsoma/tabletop/blob/master/examples/nodejs/test.js
var Tabletop = require('tabletop');
var jsonlines = require('jsonlines');
var stringifier = jsonlines.stringify();
var gs_url = 'https://docs.google.com/spreadsheets/d/1zkIeYUXJCLuUpJRYK-WvCVDxyYs9sAtqeR3p_EzjKxs/pubhtml?gid=164906169&single=true';
function onLoad(data, tabletop) {
stringifier.pipe(process.stdout)
data.forEach(set => stringifier.write(set));
};
var options = {
key: gs_url,
callback: onLoad,
simpleSheet: true
};
Tabletop.init(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment