From 450dba0642ad882e230279d0d6602b85f76d23e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Mon, 27 Sep 2021 21:18:11 +0200 Subject: rssg: Add rssg script --- bin/rssg | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 bin/rssg (limited to 'bin/rssg') diff --git a/bin/rssg b/bin/rssg new file mode 100755 index 0000000..bceb624 --- /dev/null +++ b/bin/rssg @@ -0,0 +1,37 @@ +#!/bin/sh + +. bin/func + +set -e + +current_date=$(date +"%a, %d %b %Y %H:%M:%S %z") + +cat <<-EOF > "${rss_out_file}" + + +${website_title} +${website_description} +${website_link} +$(date +"%Y") ${website_title} - All rights reserved +${current_date} +${current_date} +1800 +EOF + +for file in $(__list_files_date "${rss_dir}"); do + title=$(__get_value_title "${file}") + date=$(__get_value_date_publication "${file}") + link="${website_link}/$(__get_final_filename ${file})" + cat <<-EOF >> "${rss_out_file}" + + ${title} + ${link} + ${date} + + EOF +done + +cat <<-EOF >> "${rss_out_file}" + + +EOF -- cgit v1.2.3