diff options
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 |
