blob: bceb6245137a0655f970f604d1f9c48eb069ecb7 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/sh
. bin/func
set -e
current_date=$(date +"%a, %d %b %Y %H:%M:%S %z")
cat <<-EOF > "${rss_out_file}"
<rss version="2.0">
<channel>
<title>${website_title}</title>
<description>${website_description}</description>
<link>${website_link}</link>
<copyright>$(date +"%Y") ${website_title} - All rights reserved</copyright>
<lastBuildDate>${current_date}</lastBuildDate>
<pubDate>${current_date}</pubDate>
<ttl>1800</ttl>
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}"
<item>
<title>${title}</title>
<link>${link}</link>
<pubDate>${date}</pubDate>
</item>
EOF
done
cat <<-EOF >> "${rss_out_file}"
</channel>
</rss>
EOF
|