aboutsummaryrefslogtreecommitdiff
path: root/phlogrss
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-11-08 17:52:58 +0100
committerPhilip Wittamore <philip@wittamore.com>2025-11-08 17:52:58 +0100
commit5637b6bc9e9ca99779fd6483318f33a6fe38152d (patch)
treee7c7f5556be89e8f11ded44ca167a473032bcdfe /phlogrss
parent301c765535e2dc4e51a3b756e2b830dbe51293aa (diff)
downloadscripts-master.tar.gz
scripts-master.tar.bz2
scripts-master.zip
Diffstat (limited to 'phlogrss')
-rwxr-xr-xphlogrss22
1 files changed, 10 insertions, 12 deletions
diff --git a/phlogrss b/phlogrss
index f90d4df..fb88419 100755
--- a/phlogrss
+++ b/phlogrss
@@ -1,9 +1,9 @@
#!/usr/bin/env bash
# create a gopher rss feed
-
-root="$HOME/src/gopher/phlog"
-phloglink="gopher://spike.nagatha.fr/1/phlog"
+year="$(date +%Y)"
+root="$HOME/src/gopher/phlog/$year"
+phloglink="gopher://spike.nagatha.fr/0/phlog/$year"
description="Phil&#39;s Phlog"
rsslink="gopher://spike.nagatha.fr/0/phlog/rss.xml"
filename="$HOME/src/gopher/phlog/rss.xml"
@@ -60,18 +60,16 @@ if [[ -f $filename ]]; then
fi
touch "$filename"
-mapfile -t dir_array < <(ls -dr */)
postNum=0
-for dir in "${dir_array[@]}"; do
+files=$(ls -r *.txt)
+for file in $files; do
((postNum+=1))
- post=$dir
- post="${dir//\//}"
- title=$(head -n1 "$post/gophermap")
- postdate=$(cat "$post/gophermap" | sed -n '2p')
- linkadd="$phloglink/$post"
- description="$(cat "$post/gophermap" | sed -n "/^$/,/^$/p" | head -n 3 )..."
- build_item "$post"
+ title=$(head -n1 "$file")
+ postdate=$(cat "$file" | sed -n '2p')
+ linkadd="$phloglink/$file"
+ description="$(cat "$file" | sed -n "/^$/,/^$/p" | head -n 3 )..."
+ build_item "$file"
done
# put it all together