Created
July 11, 2011 06:51
-
-
Save samyakbhuta/1075397 to your computer and use it in GitHub Desktop.
Laoding Google Spreadsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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