aboutsummaryrefslogtreecommitdiff
path: root/scripts/atom.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/atom.sh')
-rwxr-xr-xscripts/atom.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/atom.sh b/scripts/atom.sh
index 73c35ec..d1e968f 100755
--- a/scripts/atom.sh
+++ b/scripts/atom.sh
@@ -6,14 +6,24 @@ if [[ ! -d "node_modules" ]]; then
npm i rss
fi
+RSS_DIR="$HOME/.newsboat"
+LINKS_OUT="$RSS_DIR/gen/buku.urls"
+
+mkdir -p "$RSS_DIR/gen"
+
+# Empty the text file
+> "$LINKS_OUT"
+
feed() {
local tag="$1"
local tmp="/tmp/$tag.json"
buku -t "$tag" --json > "$tmp"
- node atom.js "$tag" "$tmp"
+ node atom.js "$tag" "$tmp" > "$RSS_DIR/gen/$1.xml"
+ echo "file://$RSS_DIR/gen/$1.xml" >> "$LINKS_OUT"
}
-mkdir -p ~/.newsboat
-feed ril > ~/.newsboat/ril.xml
-feed simple-archive > ~/.newsboat/simple-archive.xml
-feed inbox > ~/.newsboat/inbox.xml
+feed ril
+feed simple-archive
+feed ril-batch
+
+cat "$DOTFILES/newsboat/urls" <(echo) "$LINKS_OUT" > "$RSS_DIR/urls"