Skip to content

Instantly share code, notes, and snippets.

@samyakbhuta
Created July 11, 2011 06:51
Show Gist options
  • Save samyakbhuta/1075397 to your computer and use it in GitHub Desktop.
Save samyakbhuta/1075397 to your computer and use it in GitHub Desktop.
Laoding Google Spreadsheet
var sys = require("sys");
var Spreadsheet = require("spreadsheet");
// Instantiate a spreadsheet using the key directly.
var sheet = new Spreadsheet("0AkUwNDE9ftXvdGMxQ2hMS2oySG9HeV9OeUtkZ2xoM1E"); //Works
//var sheet = new Spreadsheet("0Aiorqa2o8GY9dGk1MVNIMmhpZGR5YmRfTzlfdzNwZHc");
// Load the worksheets, callback will be called for each worksheet
sheet.worksheets(function(err,ws){
// Each worksheet allows you to go through each row.
if (!err){
ws.eachRow(function(err,row,meta){
console.log(sys.inspect(row));
// `row` is an object with all the fields of that row.
// `meta` is an object like {index: 1, total: 2, id: "https://...", update: Date()}
});
}
else {
console.log(err);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment