From d7df7e2b4e13e7d01fdbe75d233e4394ae5735c7 Mon Sep 17 00:00:00 2001 From: David Ashby Date: Sun, 14 May 2017 16:09:13 -0400 Subject: [PATCH] pull out sheet ID and page name --- index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 68916cb..ba5a69c 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,8 @@ var _ = require('lodash'); var SCOPES = ['https://www.googleapis.com/auth/spreadsheets']; var TOKEN_DIR = '.credentials/'; var TOKEN_PATH = TOKEN_DIR + 'sheets.googleapis.com-my-library.json'; +var SHEET_ID = '1w5Dc57wV0_rrKFsG7KM-qdPWEpqYk6lFu3JzAA0cSv0'; +var SHEET_NAME = 'Sheet1'; // Load client secrets from a local file. fs.readFile(TOKEN_DIR + 'client_secret.json', function processClientSecrets(err, content) { @@ -148,12 +150,12 @@ function appendToSheet(auth, book) { var sheets = google.sheets('v4'); sheets.spreadsheets.values.append({ auth: auth, - spreadsheetId: '1w5Dc57wV0_rrKFsG7KM-qdPWEpqYk6lFu3JzAA0cSv0', - range: 'Sheet1', + spreadsheetId: SHEET_ID, + range: SHEET_NAME, valueInputOption: "RAW", insertDataOption: "INSERT_ROWS", resource: { - "range": "Sheet1", + "range": SHEET_NAME, "majorDimension": "ROWS", "values": [ book