# gas-feed

> Feed reader library for Google Apps Script

Latest version **2.0.1** (published 2021-05-14) · Zlib license · 0 weekly downloads

## Install

```sh
npm install gas-feed
pnpm add gas-feed
yarn add gas-feed
bun add gas-feed
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-05-14 |
| First published | 2018-05-27 |
| Weekly downloads | 0 |
| License | Zlib |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | thinca |
| Maintainers | thinca |
| Keywords | Google Apps Script, feed, rss |

## Links

- npm: https://www.npmjs.com/package/gas-feed
- Repository: https://github.com/thinca/gas-feed
- Issues: https://github.com/thinca/gas-feed/issues
- npm.io page: https://npm.io/package/gas-feed

## Dependencies (1)

- [@types/google-apps-script](https://npm.io/package/@types/google-apps-script.md) 1.0.32

## Recent versions

- 2.0.1 (latest) — 2021-05-14
- 2.0.0 — 2020-08-31
- 1.0.8 — 2020-07-23
- 1.0.7 — 2020-05-04
- 1.0.6 — 2019-09-05
- 1.0.5 — 2019-06-24
- 1.0.4 — 2019-03-19
- 1.0.3 — 2018-08-14
- 1.0.2 — 2018-05-28
- 1.0.1-0 — 2018-05-28
- 1.0.1 — 2018-05-28
- 1.0.0 — 2018-05-27

## README

# Feed Reader Library for Google Apps Script

[![NPM Version][npm-image]][npm-url]
[![Test][test-ci-badge]][test-ci-action]
[![Lint][lint-ci-badge]][lint-ci-action]
[![Test Coverage][codecov-image]][codecov-url]
[![API document][doc-api-image]][doc-api-url]

A library for Google Apps Engine to read ATOM feeds.


## Features

- Read ATOM feeds via [UrlFetchApp](https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app).
  - Currently, ATOM support only.
- Store entries to Spreadsheet.
  - A store is pluggable.  Currently, `SpreadsheetStore` is only implemented.


## Requirements

- [gas-webpack-plugin](https://github.com/fossamagna/gas-webpack-plugin)


## Setup

1.  Install dependencies

    ```
    $ npm install --save-dev webpack webpack-cli gas-webpack-plugin
    $ npm install gas-feed
    ```

2.  Write `webpack.config.js`

    ```javascript
    const GasPlugin = require("gas-webpack-plugin");

    module.exports = {
      entry: "./src/index.js",
      output: {
        filename: "Code.js",
        path: __dirname + "/built",
      },
      plugins: [
        new GasPlugin(),
      ]
    };
    ```

3.  Write code using `gas-feed`

    ```javascript
    import {FeedReader, SpreadsheetStore} = require("gas-feed");

    function doGet(e) {
      // ...
    }

    // export for gas with gas-webpack-plugin
    global.doGet = doGet;
    ```

4.  Make a `Code.js` via `webpack`

    ```
    $ webpack
    ```

5.  Upload `built/Code.js`

    Copy and paste the content of code simplify or use [`clasp`](https://developers.google.com/apps-script/guides/clasp).


## Usage

Here is a most simple usage.

```javascript
// 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

[zlib License](LICENSE.txt)


## Author

thinca <thinca+npm@gmail.com>


[npm-image]: https://img.shields.io/npm/v/gas-feed.svg
[npm-url]: https://npmjs.org/package/gas-feed
[test-ci-badge]: https://github.com/thinca/gas-feed/workflows/Test/badge.svg
[test-ci-action]: https://github.com/thinca/gas-feed/actions?query=workflow%3ATest
[lint-ci-badge]: https://github.com/thinca/gas-feed/workflows/Lint/badge.svg
[lint-ci-action]: https://github.com/thinca/gas-feed/actions?query=workflow%3ALint
[codecov-image]: https://codecov.io/gh/thinca/gas-feed/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/thinca/gas-feed
[doc-api-image]: https://img.shields.io/badge/doc-API-orange
[doc-api-url]: https://thinca.github.io/gas-feed/

---
_Source: https://npm.io/package/gas-feed · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
