commit 9f0c574de688f4cf5a7fb46314f0c36333798865 Author: Mroik Date: Fri Aug 14 08:11:50 2020 +0200 Initial commit diff --git a/rssgen.sh b/rssgen.sh new file mode 100755 index 0000000..59c84be --- /dev/null +++ b/rssgen.sh @@ -0,0 +1,33 @@ +user=$(whoami) +cd ~ +read -p "Specify the blog location(~/public_html/blog/): " location +if [ -z $location ] +then + location="/home/$user/public_html/blog/rss.xml" +else + location="$location/rss.xml" +fi + +echo "" > $location +echo "" >> $location +echo "" >> $location +echo "~$user on TTBP" >> $location +echo "http://tilde.town/~$user/blog/" >> $location +echo "$(date)" >> $location +echo "$user's blog on tilde.town" >> $location + +for x in $(ls /home/$user/.ttbp/entries) +do + echo "" >> $location + echo "$(echo $x | sed -E s/\.txt//g)">> $location + echo "$(echo $x | awk '{printf substr($0,1,4) "-" substr($0,5,2) "-" substr($0,7,2)}')" >> $location + echo "http://tilde.town/~$user/blog/$(echo $x | sed -E s/\.txt/\.html/)" >> $location + echo "" >> $location + echo "$user@tilde.town" >> $location + echo "" >> $location +done + +echo "" >> $location +echo "" >> $location + +echo "Finished generating rss feed... you can now go to $(echo $location | sed -E "s/^.*public_html/http:\/\/tilde\.town\/~$user/")"