From 5637b6bc9e9ca99779fd6483318f33a6fe38152d Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Sat, 8 Nov 2025 17:52:58 +0100 Subject: update --- phlogrss | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'phlogrss') 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'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 -- cgit v1.2.3