diff options
Diffstat (limited to 'add_to_rss.sh')
-rwxr-xr-x | add_to_rss.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/add_to_rss.sh b/add_to_rss.sh new file mode 100755 index 0000000..d1e5da7 --- /dev/null +++ b/add_to_rss.sh @@ -0,0 +1,7 @@ +BASE=$(basename $1|sed s/txt$/html/) +FILE=$(cat $1|sed -E ':a;N;$!ba; s/\//\\\//g ; s/\r{0,1}\n/<\\\/p>/g;s/^/<p>/;') +echo $BASE + +sed -i "/<\!--item-->/s/$/\n\<item><pubDate><\/pubDate><guid>https:\/\/b4rkod.net.tr\/$BASE<\/guid><title>$BASE<\/title><link>https:\/\/b4rkod.net.tr\/blogposts\/$BASE<\/link><description><![CDATA[$FILE]]><\/description><\/item>/" "$HOME/www/source/rss.xml" + + |