takubokudori / Feeder

A Google Apps Script (GAS) to send translated RSS feeds to Slack.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feeder

A Google Apps Script (GAS) to send translated RSS feeds to Slack.

If you want to get arXiv feeds, please use ArXiv-feeder.

Usage

  1. Install and setup clasp and npm and Slack webhook.

  2. Clone this.

git clone https://github.com/takubokudori/Feeder
  1. Create config.ts and write a configuration.
cd Feeder
yarn install --dev
vi src/config.ts
  • An example to config.ts
import {GlobalFeedConfig} from "./configuration";

const CONFIG = {
    slack_urls: [
        "https://hooks.slack.com/services/Y0ur/w5bHO0k/URL",
    ],
    abort: "no",
    target_lang: "ja",
    translate_title: true,
    feeds: [
        {feed_url: "http://example.com/rss", source_lang: "ja", target_lang: "en"},
        "http://example.com/atom.xml",
        "http://example.com/index.rdf",
    ],
};

Edit parameters.

  • slack_urls : Slack webhook URLs.
  • abort: Abort timing. "no" by default.
    • "immediately": Abort immediately when an error occurs.
    • "yes": Accumulate a log when an error occurs and finally abort.
    • "no": Accumulate a log when an error occurs and finally do not abort.
  • source_lang : Source language. "en" by default.
  • target_lang : Target language. No translation by default.
  • translate_title : If this is true, titles will be translated. false by default.
  • feeds : RSS feed URLs.
    • feeds can specify a URL string, or a config object.
    • Each feed can have its own configurations, which can override the global configurations.
  1. Upload to GAS.
clasp create Feeder
# Create "sheets" script.
clasp push
  1. Grant the app. (First, execute dryRun to initialize the acquired ID list.)

  2. Set a trigger.

trigger

LICENSE

See ./LICENSE

About

A Google Apps Script (GAS) to send translated RSS feeds to Slack.

License:Apache License 2.0


Languages

Language:TypeScript 77.4%Language:JavaScript 22.6%