diff options
author | b4rkod <lllillilll@protonmail.com> | 2024-05-15 23:50:36 +0300 |
---|---|---|
committer | b4rkod <lllillilll@protonmail.com> | 2024-05-15 23:50:36 +0300 |
commit | 0e97f4e9e7672743bc9b04a2efa0b68d7f9bfa14 (patch) | |
tree | 49c7f49b5d04ceed2e94c3aa8945a5d2cf3dc64a /add_to_rss.sh | |
parent | 3624bc6c786a438c429615589225da9e121e42c9 (diff) |
redid everything, not at the documentation stage
Diffstat (limited to 'add_to_rss.sh')
-rwxr-xr-x | add_to_rss.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/add_to_rss.sh b/add_to_rss.sh index 0c4e0b3..c829f9f 100755 --- a/add_to_rss.sh +++ b/add_to_rss.sh @@ -1,7 +1,8 @@ -BASE=$(basename $1|sed s/txt$/html/) -FILE=$(cat $1|sed -E ':a;N;$!ba; s/\/\/\///g ;s/\//\\\//g ; s/\r{0,1}\n/<\\\/p>/g;s/^/<p>/;') -echo $BASE +FILE=$(cat $1 | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g'| sed "s#\/#\\\/#g" ) -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" +BASE=$(basename $1) + +RSS_DATE=$(date -d "$(stat -c %w $1)" -R) +sed -i "/<\!--item-->/s/$/\n<item>\n<pubDate>$RSS_DATE<\/pubDate>\n<guid>https:\/\/b4rkod.net.tr\/$BASE<\/guid>\n<title>$BASE<\/title>\n<link>https:\/\/b4rkod.net.tr\/blogposts\/$BASE<\/link>\n<description><![CDATA[$FILE]]><\/description>\n<\/item>/" "$HOME/www/source/rss.xml" |