diff options
| author | Philip Wittamore <philip@wittamore.com> | 2025-11-08 17:52:58 +0100 |
|---|---|---|
| committer | Philip Wittamore <philip@wittamore.com> | 2025-11-08 17:52:58 +0100 |
| commit | 5637b6bc9e9ca99779fd6483318f33a6fe38152d (patch) | |
| tree | e7c7f5556be89e8f11ded44ca167a473032bcdfe /phlogrss | |
| parent | 301c765535e2dc4e51a3b756e2b830dbe51293aa (diff) | |
| download | scripts-master.tar.gz scripts-master.tar.bz2 scripts-master.zip | |
Diffstat (limited to 'phlogrss')
| -rwxr-xr-x | phlogrss | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -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 |
