Giter Site home page Giter Site logo

gulp-google-spreadsheets's Introduction

Gulp-Google-Spreadsheets

Gulp plugin to load a Google Spreadsheet and emit each worksheet as a file in a Vinyl stream.

Installation

npm install gulp-google-spreadsheets

Usage

Publish a spreadsheet to the web, then use its id as input to this module, the way you would use a directory as input to gulp.src(). It emits a json file for each worksheet, which you can pipe into a page renderer:

gulpSheets = require('gulp-google-spreadsheets')

gulp.task('fetch-data', ->
    gulpSheets(spreadsheetId)
    .pipe(renderTemplates)
    .pipe(gulp.dest('./public/'))
)

Or, if you want to archive the data, pipe it to files:

gulp.task('fetch-data', ->
    gulpSheets(spreadsheetId)
    .pipe(gulp.dest('./data'))
)

gulp.task('content', ['fetch-data', 'compile-templates'], ->
    gulp.src('./data')
    .pipe(renderTemplates)
    .pipe(gulp.dest('./public/'))
)

TO DO

  • Subscribe to a feed and emit changes in the same style as gulp.watch()

gulp-google-spreadsheets's People

Contributors

jjclark1982 avatar

Stargazers

Omar López avatar Carson avatar Alan avatar Keisei Shigeta avatar

Watchers

 avatar James Cloos avatar Benjamin Johnston avatar  avatar Le Kang avatar Xun avatar

Forkers

davidpanik

gulp-google-spreadsheets's Issues

listen to changes in spreadsheet

Is there a way to listen to the changes(on any cell) on spreadsheet and if change happened, fetch the json. Help please. Thanks for attention.

Unexpected close tag

I'm getting the following error when using this library.

My code....

gulp.task('fetch', () => {
  return gulpSheets(DATA.sheets)
    .pipe(gulp.dest('./src/data'));
});
[11:38:29] Error: Unexpected close tag
Line: 1256
Column: 9
Char: >
    at error (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/sax/lib/sax.js:651:10)
    at strictFail (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/sax/lib/sax.js:677:7)
    at closeTag (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/sax/lib/sax.js:871:9)
    at SAXParser.write (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/sax/lib/sax.js:1436:13)
    at Parser.exports.Parser.Parser.parseString (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/xml2js/lib/parser.js:322:31)
    at Parser.parseString (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/xml2js/lib/parser.js:5:59)
    at Request._callback (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/gulp-google-spreadsheets/node_modules/google-spreadsheet/index.js:180:20)
    at Request.self.callback (/Users/ajenkins/Code/devtools/aurora-sites/node_modules/gulp-google-spreadsheets/node_modules/request/request.js:123:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.