2.0.1 • Published 4 years ago
gas-feed v2.0.1
Feed Reader Library for Google Apps Script
A library for Google Apps Engine to read ATOM feeds.
Features
- Read ATOM feeds via UrlFetchApp.
- Currently, ATOM support only.
 
 - Store entries to Spreadsheet.
- A store is pluggable.  Currently, 
SpreadsheetStoreis only implemented. 
 - A store is pluggable.  Currently, 
 
Requirements
Setup
Install dependencies
$ npm install --save-dev webpack webpack-cli gas-webpack-plugin $ npm install gas-feedWrite
webpack.config.jsconst GasPlugin = require("gas-webpack-plugin"); module.exports = { entry: "./src/index.js", output: { filename: "Code.js", path: __dirname + "/built", }, plugins: [ new GasPlugin(), ] };Write code using
gas-feedimport {FeedReader, SpreadsheetStore} = require("gas-feed"); function doGet(e) { // ... } // export for gas with gas-webpack-plugin global.doGet = doGet;Make a
Code.jsviawebpack$ webpackUpload
built/Code.jsCopy and paste the content of code simplify or use
clasp.
Usage
Here is a most simple usage.
// Get parameters from PropertiesService.
const props = PropertiesService.getScriptProperties();
const FEED_URL = props.getProperty("FEED_URL");
const SPREADSHEET_ID = props.getProperty("SPREADSHEET_ID");
const SHEET_NAME = props.getProperty("SHEET_NAME");
const store = new SpreadsheetStore(SPREADSHEET_ID, SHEET_NAME);
const reader = new FeedReader(WATCH_TARGET, store);
const newlyFeeds = f.fetch();
// Do something for newlyFeeds...
reader.save();License
Author
thinca thinca+npm@gmail.com