Go to file
Tim Van Baak bb1bdee4c9 Init Flask app 2023-05-29 18:19:33 -07:00
intake Init Flask app 2023-05-29 18:19:33 -07:00
tests Add edit command 2023-05-29 17:05:48 -07:00
.gitignore Init Flask app 2023-05-29 18:19:33 -07:00
LICENSE Add gitignore and license 2023-05-29 10:52:56 -07:00
README.md Add submodule and cli for executing source fetches 2023-05-29 15:14:19 -07:00
default.nix Add flask to build deps and add some dev deps to shell 2023-05-29 13:46:19 -07:00
pyproject.toml Init minimum installable package 2023-05-29 10:59:28 -07:00
shell.nix Add flask to build deps and add some dev deps to shell 2023-05-29 13:46:19 -07:00
vm.nix Test a configuration for using basic auth with reverse proxy 2023-05-29 10:55:03 -07:00

README.md

intake

intake is an arbitrary feed aggregator.

Feed Source Interface

The base intake directory is $XDG_DATA_HOME/intake. Each feed source's data is contained within a subdirectory of the base directory. The name of the feed source is the name of the subdirectory.

Feed source directories have the following structure:

intake
 |- <source name>
 |   |- intake.json
 |   |- state
 |   |- <item id>.item
 |   |- <item id>.item
 |   |- ...
 |- <source name>
 |   |  ...
 | ...

intake.json must be present; the other files are optional. Each .item file contains the data for one feed item. state provides a file for the feed source to write arbitrary data, e.g. JSON or binary data.

intake.json has the following structure:

{
  "fetch": {
    "exe": "<absolute path to program or name on intake's PATH>",
    "args": ["list", "of", "program", "arguments"]
  },
  "action": {
    "<action name>": {
      "exe": "...",
      "args": "..."
    }
  },
  "env": { ... }
}

fetch is required. If action or env are absent, they will be treated as if they were empty.

When a feed source is updated, fetch.exe will be executed with fetch.args as arguments. The following environment variables will be set:

  • STATE_PATH is set to the absolute path of state.
  • Each key in env in config.json is passed with its value.

Each line written to the process's stdout will be parsed as a JSON object representing a feed item. Each line written to stderr will be logged by intake. stdout and stderr are decoded as UTF-8.

If invalid JSON is written, intake will consider the feed update to be a failure. If the exit code is nonzero, intake will consider the feed update to be a failure, even if valid JSON was received. No changes will happen to the feed state as a result of a failed update.

Item actions are performed by executing action.<name>.exe with action.<name>.args as arguments.