From 34514d0686ce42f5e55e750f873c537eae476513 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 5 May 2021 12:48:48 +0100 Subject: can parse meta date from feed's file name --- buetow.org.sh | 10 ++++++---- content/gemtext/gemfeed/atom.xml | 4 ++-- content/html/gemfeed/atom.xml | 4 ++-- .../meta/gemfeed/2010-05-09-the-fype-programming-language.meta | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/buetow.org.sh b/buetow.org.sh index d8ead249..c9b3c75e 100755 --- a/buetow.org.sh +++ b/buetow.org.sh @@ -26,7 +26,6 @@ ERROR ## Atom module atom::meta () { - local -r now="$1"; shift local -r gmi_file_path="$1"; shift local -r meta_file=$(sed 's|gemtext|meta|; s|.gmi$|.meta|;' <<< "$gmi_file_path") @@ -38,9 +37,12 @@ atom::meta () { local title=$(sed -n '/^# / { s/# //; p; q; }' "$gmi_file_path" | tr '"' "'") # Extract first paragraph from Gemtext local summary=$(sed -n '/^[A-Z]/ { p; q; }' "$gmi_file_path" | tr '"' "'") + # Extract the date from the file name. + local filename_date=$(basename $gmi_file_path | cut -d- -f1,2,3) + local date=$(date --iso-8601=seconds --date "$filename_date $(date +%H:%M:%S)") cat <> "$atom_file.tmp" @@ -93,7 +95,7 @@ ATOMENTRY ATOMFOOTER # Delete the 3rd line of the atom feeds (global feed update timestamp) - if ! diff -u <(sed 3d "$atom_file.tmp") <(sed 3d "$atom_file"); then + if ! diff -u <(sed 3d "$atom_file") <(sed 3d "$atom_file.tmp"); then echo "Feed got something new!" mv "$atom_file.tmp" "$atom_file" git add "$atom_file" diff --git a/content/gemtext/gemfeed/atom.xml b/content/gemtext/gemfeed/atom.xml index 57a2d485..10049994 100644 --- a/content/gemtext/gemfeed/atom.xml +++ b/content/gemtext/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2021-05-05T09:27:32+01:00 + 2021-05-05T12:48:29+01:00 buetow.org feed Having fun with computers! @@ -76,7 +76,7 @@ The Fype Programming Language gemini://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.gmi - 2010-05-09T09:26:28+01:00 + 2010-05-09T12:48:29+01:00 Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.. .....to read on please visit my site. Paul Buetow diff --git a/content/html/gemfeed/atom.xml b/content/html/gemfeed/atom.xml index ff147c01..f9b5cf5b 100644 --- a/content/html/gemfeed/atom.xml +++ b/content/html/gemfeed/atom.xml @@ -1,6 +1,6 @@ - 2021-05-05T09:27:32+01:00 + 2021-05-05T12:48:29+01:00 buetow.org feed Having fun with computers! @@ -76,7 +76,7 @@ The Fype Programming Language https://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.html - 2010-05-09T09:26:28+01:00 + 2010-05-09T12:48:29+01:00 Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.. .....to read on please visit my site. Paul Buetow diff --git a/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta b/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta index 77c4a44d..a6265580 100644 --- a/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta +++ b/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta @@ -1,4 +1,4 @@ -local meta_date="2010-05-09T09:26:28+01:00" +local meta_date="2010-05-09T12:48:29+01:00" local meta_author="Paul Buetow" local meta_email="comments@mx.buetow.org" local meta_title="The Fype Programming Language" -- cgit v1.2.3