diff options
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | bash/aliases.sh | 1 | ||||
-rw-r--r-- | newsboat/urls | bin | 589 -> 653 bytes | |||
-rw-r--r-- | nixos/configuration.nix | 3 | ||||
-rw-r--r-- | scripts/atom.js | 22 | ||||
-rwxr-xr-x | scripts/atom.sh | 19 |
6 files changed, 48 insertions, 0 deletions
@@ -1,3 +1,6 @@ mail/offlineimap.pyc tam_required /result + +/scripts/node_modules/ +/scripts/package-lock.json
\ No newline at end of file diff --git a/bash/aliases.sh b/bash/aliases.sh index 52d24b4..e8ff449 100644 --- a/bash/aliases.sh +++ b/bash/aliases.sh @@ -24,6 +24,7 @@ alias sbcl="rlwrap sbcl" alias du="ncdu --color dark" alias perl6="rlwrap perl6" alias m="mail.sh" +alias a="atom.sh" alias gnome-control-center="XDG_CURRENT_DESKTOP=GNOME gnome-control-center" diff --git a/newsboat/urls b/newsboat/urls Binary files differindex 444e1a7..1047793 100644 --- a/newsboat/urls +++ b/newsboat/urls diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 36a2474..6f8c7e0 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -333,6 +333,9 @@ # Sync emails with mbsync every hour "0 * * * * andreh /home/andreh/dev/libre/dotfiles/scripts/mail.sh -s" + # Refresh local RSS files every hour + "0 * * * * andreh /home/andreh/dev/libre/dotfiles/scripts/atom.sh" + # Make read-only copy of TODOs.org every hour # "0 * * * * andreh /home/andreh/dev/libre/dotfiles/scripts/cp-todos.sh -s" ]; diff --git a/scripts/atom.js b/scripts/atom.js new file mode 100644 index 0000000..878df05 --- /dev/null +++ b/scripts/atom.js @@ -0,0 +1,22 @@ +const RSS = require('rss'); + +const feedName = process.argv[2]; +const feedSrc = process.argv[3]; + +const feed = new RSS({ + title: `Buku feed tag for '${feedName}'.`, + description: `Buku feed tag for ${feedName}`, +}); + +const items = require(feedSrc); +items.forEach(({ title, description, uri }) => { + feed.item({ + title, + description, + url: uri + }); +}); + +const xml = feed.xml({indent: true}); + +console.log(xml); diff --git a/scripts/atom.sh b/scripts/atom.sh new file mode 100755 index 0000000..73c35ec --- /dev/null +++ b/scripts/atom.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +if [[ ! -d "node_modules" ]]; then + npm i rss +fi + +feed() { + local tag="$1" + local tmp="/tmp/$tag.json" + buku -t "$tag" --json > "$tmp" + node atom.js "$tag" "$tmp" +} + +mkdir -p ~/.newsboat +feed ril > ~/.newsboat/ril.xml +feed simple-archive > ~/.newsboat/simple-archive.xml +feed inbox > ~/.newsboat/inbox.xml |