diff options
| author | Philip Wittamore <philip@wittamore.com> | 2025-10-31 18:00:28 +0100 |
|---|---|---|
| committer | Philip Wittamore <philip@wittamore.com> | 2025-10-31 18:00:28 +0100 |
| commit | 301c765535e2dc4e51a3b756e2b830dbe51293aa (patch) | |
| tree | c60aa11e988f7d739832d1751ec23166ded40cd7 /phlogrss | |
| parent | eeb13fe28b74b8d9888cb4443b6bb0a874f9b047 (diff) | |
| download | scripts-301c765535e2dc4e51a3b756e2b830dbe51293aa.tar.gz scripts-301c765535e2dc4e51a3b756e2b830dbe51293aa.tar.bz2 scripts-301c765535e2dc4e51a3b756e2b830dbe51293aa.zip | |
Diffstat (limited to 'phlogrss')
| -rwxr-xr-x | phlogrss | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -2,8 +2,7 @@ # create a gopher rss feed -cd "$HOME/src/gopher/phlog" || exit - +root="$HOME/src/gopher/phlog" phloglink="gopher://spike.nagatha.fr/1/phlog" description="Phil's Phlog" rsslink="gopher://spike.nagatha.fr/0/phlog/rss.xml" @@ -11,6 +10,8 @@ filename="$HOME/src/gopher/phlog/rss.xml" builddate=$(date --iso-8601=ns) buildyear=$(date +%Y) +cd $root || exit + # Build RSS header & footer build_header () { echo "<?xml version='1.0' encoding='UTF-8' ?> @@ -40,7 +41,7 @@ build_item () { <pubDate>$postdate</pubDate> <link>$linkadd</link> <guid>$linkadd</guid> - <description>$description</description> + <description><![CDATA[$description]]></description> </item>" >> ~/feed } @@ -69,7 +70,7 @@ for dir in "${dir_array[@]}"; do title=$(head -n1 "$post/gophermap") postdate=$(cat "$post/gophermap" | sed -n '2p') linkadd="$phloglink/$post" - description="$(cat "$post/gophermap" | sed -n "/^$/,/^$/p" | head --lines 3) …" + description="$(cat "$post/gophermap" | sed -n "/^$/,/^$/p" | head -n 3 )..." build_item "$post" done |
